Is there a script to spin? not a stupid rotate that moves the object instead of spinning
The following script will rotate a GameObject around it’s pivot point. I’m assuming this is what you wanted.
In C#
using UnityEngine;
using System.Collections;
class Rotator : MonoBehaviour
{
public Vector3 rotateVec;
void Update()
{
transform.Rotate(rotateVec * Time.deltaTime);
}
}
And JavaScript
public var rotateVec:Vector3;
function Update()
{
transform.Rotate(rotateVec * Time.deltaTime);
}
If your object still seems to move around, your pivot point might not be centered. Try creating an Empty GameObject, make your object a child of this new GameObject and assign the rotator script to that GameObject. You’ll have to move your object so that it’s around the center of the new GameObject.
Hope this helps!
Ur code didnt work but my old code plus a cube worked, thank you soo freaking much, im gussing my rotors were messed up cause I couldn’t even make an animation in 3ds max