This is the Unity documentation for Character Controllers:
I wish it said that a GameObject with a Character Controller attached can only be rotated on the x axis from 270 degrees through 360-0 degrees to 90 degrees. You can’t rotate its x axis to 100 degrees, 180 degrees, or 260 degrees, according to a test I just ran. That means your player GameObject with the attached Character Controller can never flip, stand on his head, or do a cartwheel on that axis (unless that’s pure animation that doesn’t require the GameObject to actually rotate).
Here’s the test, in case you want to try it yourself:
function Update() {
gameObject.rotation.eulerAngles.x += 1; //rotate 1 degree per frame
}
Attach that code to an elongated GameObject so you can see it rotating. Attach a Character Controller to that GameObject too. Then run the scene. When I did it, it only rotated to 90 degrees.
Another test is to set the x rotation of the GameObject to 180 before the scene runs, then run the scene and quickly pause it. If you switch to scene view right then, you should see that the GameObject no longer has a rotation of 180 degrees.
Why did I discover this? Because in my game I have guys running around with Character Controllers attached. When there’s an explosion I programmed them to get flung away and to spin. Spinning them on the y-axis and z-axis worked fine but on the x-axis they’d get stuck and vibrate. Not very realistic-looking.
PS: I sure hope I’m not wrong about this. That would be embarrassing to have written all this if it was just programmer error!