When using SimpleMove, if I hit a collider at a diagonal, my character will slide along the collider. Is there a way to get it to just stop all movement on collision instead? I’ve tried to use Move instead, but Move seems to move the character at a constant rate. I need acceleration as well. Basically, I’m calculating fall speed and putting the amount to fall each frame into SimpleMove. The problem is, when I collide with the ground at a diagonal, the character slides along the ground. I want the character to immediately stop when he hits the ground instead.
You’re gonna have to you regular old Move() for that, I’m afraid.
In order to have acceleration, all you need to do is lerp vectors like so:
inputVector = new Vector3(Input.GetAxis("Horizontal"), 0, Input.GetAxis("Vertical"); acceleration = 0.25f; moveVector = Vector3.Lerp(moveVector, inputVector, acceleration); controller.Move(movevector * speed);