I’m making a 3D platformer, and at the moment my character is quite floaty and slippery when moving around. I want to implement friction, so the movement will be much tighter.
At the moment, my plan is to, every frame, subtract from the character’s velocity. When the character stops moving, it should obviously stop at 0.
The problem I’m having is that I don’t know how to implement this when both positive and negative values exist. The top speed is 4, so obviously the character’s velocity on both x and z axis needs to be clamped at -4 to 4. But how would you then ensure that when there is no input that the velocity cannot pass 0?
Or am I thinking about this the wrong way? Is there a better way to implement friction? Really struggling with this one.
All help appreciated, thanks!