- Home /
First object works but the second doesnt?
so I have a building that when instantiated finds the needed gameobject and sets the object to true and works. However if I put a second one in, it will leave the find object screen blank. Although when i manually put the needed gameobject into it, it works like the first, but now the first wont activate the object, Any ideas on how to fix this issue?
Answer by Wraifen_09 · Jul 23, 2018 at 02:01 AM
its all good, the answer was I couldn't get a deactive object, the work around was make a parent and refer to that parent and get the deactive item from the parent that was always on but hidden. Eg., Buttons = GameObject.Find("BarrackButtons").transform.GetChild(0).gameObject;
was how i fixed this issue and got the object.
Answer by swanne · Jul 16, 2018 at 03:58 PM
What request are you using to find the needed gameObject? Are you using Find, FindObjectWithTag, FindObjectOfType, etc?
It may also be effected by where the Instantiated object is instantiated in the hierachy. Sometimes a parent - child relationship can help or hinder what you set out to do.
Share the section of code that you use to locate the needed gameObject
Your answer
![](https://koobas.hobune.stream/wayback/20220612170739im_/https://answers.unity.com/themes/thub/images/avi.jpg)