RigidController Crazyness!

I coded up my own rigidbody based character controller. It’s really simple, but I need some help. Basically Left and Right arrows rotate you and up adds relative forward force. So here’s the problem. When you start running real fast and then turn, you’re still sliding in the first direction you ran. Any way to cancel the force when you use the left and right arrows? Thanks!

Okay, if I’m going to be using that, then can I make the character rotate to face the direction he’s walking. I’m pretty sure I asked this before and didn’t get much in response other than the Non-Rigidbody Character Controller, which rotates with Left and Right and moves forward with up, which is not what I want. I tried putting objects on all sides of him and had him use transform.LookAt, but he looked sort of at an angle and it was really screwing up my collisions.

You can rotate your character controller or rigidbody as you like, but you want to make sure you rotate only around the y-axis. If you have a human like character it’s going to be a little weird if you tilt the capsule up and down.

So you probably want to use something like this:

var theDirectionYouWantToLook = ...;
theDirectionYouWantToLook.y = 0;
transform.rotation = Quaternion.LookRotation(theDirectionYouWantToLook);