#How to disable already existed clones/instances of my game object?

1 messages · Page 1 of 1 (latest)

ocean ridge
#

Hey, guys! I have a small problem. I am instantiating game object but whenever I want to enable my options menu my clone game objects are still active. So, I have a game object to my prefabs and I am instantiating them. For one reason only my first original game object deactivates but my clones/instances are staying there. Can you please me?

warped island
#

You could add all the instantiated objects to a list, then destroy them when you need to

wraith reef
#

Show code

ocean ridge
#

Tell me whatever you want here I will see it tomorrow. Thanks!

#

Oh, I got a video as well to show you

cold pagoda
#

just parent them under a gameobject ie. Trees when u create them. And disable / enable that (1) gameobject..

#

otherwise you'll need to track every tree you spawn and and enable/disable all of em..

#

in a list<> for example, and disabling them running a for/foreach loop..

#

1s easier than the other obv

warped island
ocean ridge
#

@cold pagoda So, what do you mean to parent them ? You mean my tree logs?

#

What I do is that I am instantiating my game object everytime

#

Thats why you see tree logs (clones) so I don't know how to disable these clone objects when pressing settings to enable options menu

cold pagoda