I'm having trouble with some physics code. When the user presses an arrow key, it adds/subtracts 0.25 to the character's x velocity. Then the world steps, which should add/subtract 0.05 to get it closer to 0. This output of the velocity for each step shows what went wrong:
This gets things confused and the character will keep creeping along slowly in the same direction, while going through things it would normally collide with.
What might be wrong?
Rounding to 2 decimal places would work, but I want to see if there is a better way first.
When I jump, sometimes my feet get stuck in the ground, I'm assuming that's a related problem.