I'm using the CharacterController (together with my own scripts) to control the player character.
I want to make the up-vector of the player to point in the same direction as the normal of the ground he's standing on, but for some reason that just won't work.
I've used the transform.Lookat() function for this, but it often seems to not do anything at all. So I'm wondering if the CharacterController perhaps alters it's upvector itself ?
cause even when I do a simple test like this:
newup = transform.forward*0.5 + transform.up*0.5;
newdir = Quaternion.FromToRotation ( transform.up, newup ) * transform.forward;
transform.LookAt( transform.position+newDir, newup );
it does nothing at all
transform.forward and transform.up are unchanged afterwards, instead of beeing equal to newdir and newup.
I've also tried rotating the player character, but this doesn't work correctly either
Any help ?