- Home /
How to rotate the character controller?
I tried this:
function Start () {
gameObject.transform.Rotate(90,0,0);
}
Everything inside of the character controller rotates, but the movement controls and collider stay the same as if they are not rotated at all. How do I rotate them? I'm trying to make a prone script.
Answer by ExTheSea · May 23, 2013 at 06:56 PM
The standard MouseLook-Script does it using this:
transform.localEulerAngles = new Vector3(90, 0, 0);
Is that to rotate the camera? That's not what I'm going for.
This is not dependent on the component. The $$anonymous$$ouseLook-Script isn't dependent on any Camera Component either. It is totaly possible to make a cube . attach a $$anonymous$$ouselook script and then rotate the cube using the mouse without any Camera involved.
Then you have to rotate the gameobject these component are attached to. Which gameobject you choose depends on your setup.
Like I said, I did that. It rotates everything inside, but the cotnrols and collider don't change.