Am trying to make a Script that can Rotate on X,Y,Z. So i can change the var, So that i have different game objects that use the same Rotate script. But i want to change some game objects to rotate other ways then some. also change the speed of what there going. Please help. PHP: var speedForChange: int; function Update () { transform.Rotate(0, speedForChange*Time.deltaTime,0); }
Code (csharp): var rotateAxis : Vector3; function Update () { transform.Rotate(rotateAxis * Time.deltaTime); } So if e.g. you put 0, 45, 0 in rotateAxis, it will rotate 45 degrees per second around the Y axis. --Eric