According to the script reference, Destroy and Instantiate are both members of the Object class. But when I inherit from Object, I can’t call Destroy or Instantiate with the class without getting an error.
‘Instantiate is not a member of myClass’
According to the script reference, Destroy and Instantiate are both members of the Object class. But when I inherit from Object, I can’t call Destroy or Instantiate with the class without getting an error.
‘Instantiate is not a member of myClass’
Can you please post your class code and the code calling destroy? It’s probably just a tiny little thing to fix.
Thanks, but I figured out a work around. Rather than inherit from Object, I just call Destroy like so:
GameObject.Destroy(item);
“Destroy” is actually a static method, so you can simply call UnityEngine.Object.Destroy.