it's important that your script is allowed to inherit from monobehaviour which is a base class in the UnityEngine namespace.
to inherit from monobehaviour, your script must at least look like the following:
using UnityEngine;
using System.Collections;
public class MyClass : MonoBehaviour
{
}
did you accidentally remove the "using UnityEngine;" from the top???
↧