instantiate a parent only prefab and hide child prefab
Is this possible? I've search on the net but can't find it. I'm planning to show the parent prefab and hide the child prefab for later use. Thanks in advance
Answer by b1gry4n · Oct 15, 2016 at 01:24 PM
Making a prefab with a deactivated child is exactly that. A prefab with a child object that is not activated. It will be instantiated the same way.
if the object in the prefab is not active (the check box in the inspector to turn game objects off/on) it will not be active when instantiated. if you are asking how to turn game objects off by script its
gameObject.SetActive(false);
Theres nothing special about a prefab other that being able to save game objects as assets and instantiate them from assets. They are just game objects and shouldnt be treated any different after they have been instantiated.