Player glitches and rotates uncontrobally when I play the game

I found a previous question like this, but it was unanswered and someone left a comment saying:

Can anybody explain how I can fix this?

Because when ever i spawn in my 3D fps game I can’t properly control my player and I can’t find the problem.

You probably just have to set RigidBody.freezeRotation to true. You’ll still be able to call Rigidbody.MoveRotation() and rotate the player manually, but it will not lose control when hit with another collider.

@jmancoder, thanks it seems to have worked