These days I have tried to hide and show a GameObject at runtime, but once it is “hidden” with SetActive and I search for the GameObject with .Find (“GameObjectName”) returns null. Can you help me solve this problem?
Either drag a reference to the GameObject into the scene, or if you must use GameObject.Find(), then once you find it the first time, keep a reference to it and use that to turn it back on later.
79/5000
I had already tried to make a reference before deactivating the GameObject, but still can’t find the GameObject
So you can turn the GameObject to hidden but not back?
Exactly
If you search for a hidden object it won’t find it. Either you have to reference it (depends on what this code those) or save it in an array or list and loop thru and enable it again.