- Home /
Prefab Variable is always Null when GameObject is Disabled
I have a class "myClass" with a public variable:
public GameObject myPrefab;
and later I call:
Instantiate(myVariable);
Normally, this works fine. However, if the GameObject with "myClass" attached to it is Disabled, "myPrefab" is considered Null by the engine, and thus cannot Instantiate the prefab. This seems really stupid to me and I can't see any way around it (except for having some sort of Prefab Manager which I would rather not do). Have I missed something?
Comment
Your answer
