I would like my character controller to tilt about the y-axis to follow the normals of the terrain (so for example, the character looks uphill when traveling uphill, instead of remaining at 90 degrees vertical). Does anyone have an example how to use:
ControllerColliderHit.normal
I am trying to read the values from this into my character’s Y rotation, but getting one error after another. No documentation in the manual. Thanks!
Create another GameObject specifically to follow the CharacterController.
Don’t try to rotate the CharacterController - you can’t. That is because it is highly optimized to do exactly what it does - never pass through the ground.
If you are just rotating a character, you can have your second GameObject always move to the position of the CharacterController, orient the same way in Y and then use the normals to orient rotations in X and Z.
We’ve done a few controls this way, and it works quite nicely.