- Home /
How can I destroy an specific clone already instantiated, when there's more than one?
Hello community.
Now I'm generating a game object that's name is "PowerUp" and when it's instantiated the name is "PowerUp(Clone)".
By now I'm destroying it by contact, the "PowerUp(Clone)" that's instantiated with a tag, the problem is that all "PowerUp(clone)" are disappearing by using it through tag and I want them dissapears one by one by other game object contact.
Anyone know how to individualice more when a game object is instantiated?
Any help will be appreciated.
Thanks
Regards.
Answer by cjdev · Aug 09, 2015 at 02:08 AM
You could assign the instantiated GameObjects to a List and reference each individual object in that way. For your particular application though you might consider using OnCollisionEnter from the Collider in your PowerUp object to handle it's own destruction when the player hits it.