- Home /
Any way to disable SimpleMove's sliding?
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.
Answer by Jackv949 · Jan 06, 2015 at 03:36 AM
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);
I must be losing it because now I'm seeing the exact opposite happen as what's in my OP. $$anonymous$$ove is causing the sliding and correctly using acceleration and Simple$$anonymous$$ove is moving at a constant rate.