Rotate script doesn't work!

I’M USING UNITY 4.5

THIS IS THE SCRIPT TO MAKE AN OBJECT ROTATE.

it say: The referenced script on this Behaviour is missing

using UnityEngine;
using System.Collections;

public class Rotator : MonoBehaviour
{
void Update()
{
transform.Rotate(new Vector3 (15, 30, 45) * Time.deltaTime);

}

}

WHAT IS MY PROBLEM!? (i’m making an fps arena and my pickups doesn’t want to rotate)

You did one of those things:

  • You deleted your script file but have it still attached to a gameobject.
  • You moved the script to another location in your project outside of Unity. This will break any asset links in general. If you want to move an asset, move it inside Unity.
  • You renamed an asset or one of the parent folders outside of Unity. Same advice as the last point.

If your script is still there, somewhere in your assets folder / subfolder, just select the object the script was attached to. You should see at the top of your script component on that object a field where it says something like “Missing MonoBehaviour”. Now simply grab your script from your asset folder and drag it to that field in the inspector. This should “relink” the component with the actual script file.