Not sure how to stop collision from nudging player in unintended direction

Hi all!

Thanks for taking the time to help out if you’ve stopped by. :slight_smile:

I’m working on a 2D platformer for which I’ve created a character controller that uses the built-in physics system (colliders, rigidbodies etc.).

I’ve run into a bug where the player is nudged away in an unintended direction after leaving the vicinity of a wall. The only intended forces acting on the player are gravity and a launch force that moves the player in a given (inputted) direction.

Any guidance would be helpful :sweat_smile:

Thanks!

HALp

Are you talking about the fact that the player goes a little to the right when jumping?
If that’s the case, it’s due to the fact that you are using a capsule collider. When you hit the edge with the rounded corner it pushes you to the side.