playerController.cs (controller in question)
cameraController.cs
- I have movement relative to the camera.
- Character is a ball
I want to stop my player from moving when the velocity of an axis falls below a certain threshold (and there is no input), but simply setting “velocity = 0” doesn’t completely stop the movement.
In Line 121, using else if for both axes stops the movement after a few fixed updates, but it causes issues with jumping, making the player move along the X and Z axes (this only happens when the camera has been moved).
In Line 141, using else if for both axes stops the player momentarily (as seen only with Debug.Log), but then the player decelerates according to rigid body physics. Additionally, jumping does not affect the X and Z axes, which might be because the last else if is only called “once”.