This code:
using UnityEngine;
using System.Collections;
public class DisableMoveWhileFlying : MonoBehaviour {
void Start(){
obj = GetComponent<Move>();
}
void OnCollisionExit(){
obj.enabled = false;
}
void OnCollisionEnter(){
obj.enabled = true;
}
}
Throws this error (twice):
error CS1061: Type `UnityEngine.Component' does not contain a definition for `enabled' and no extension method `enabled' of type `UnityEngine.Component' could be found (are you missing a using directive or an assembly reference?)
What am I doing wrong?