If your player continues moving when they should be idle

In the PlayerIdleState script my player was continuing to drift once transitioned in from the Move State. Not sure why, perhaps I missed something in the code, or perhaps float imprecision or framerate overshooting the method in some way?

Anyway, if you get the same issue, here is how I fixed in the PlayerIdleState Script:

It looks like the MoveAndSlide method is still being called either in the PlayerMoveState.cs or the player.cs; check that setPhysicsProcess is being set to false for the PlayerMoveState and the MoveAndSlide functionality is no longer inside of Player.cs

Privacy & Terms