-
I'm trying to create a simple 2d rpg style game. I've turned off gravity and simply am trying to get my player character to collide and stop when hitting an object. The current behavior is they glide through, but will slowly "slide" off the object if they are collided. The player is set up like so:
and the static object like this:
To move my character, I use something like this:
Any suggestions on how to properly configure the physics for a basic interaction like this? Ideally this should work without me needing to do manual collision detection :/ Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
Updating the transform as you do, is teleporting the object each frame, ignoring all physics rules. If you want a more realistic behavior (like not passing through other objects :-p) then it's more appropriate to use the velocity component. See: https://docs.rs/heron/latest/heron/#move-rigid-bodies-programmatically |
Beta Was this translation helpful? Give feedback.
Updating the transform as you do, is teleporting the object each frame, ignoring all physics rules.
If you want a more realistic behavior (like not passing through other objects :-p) then it's more appropriate to use the velocity component.
See: https://docs.rs/heron/latest/heron/#move-rigid-bodies-programmatically