|
Hi! I am kind of new to Unity so please be patient. I have a script that Instantiates a crate every two seconds, and that's fine. In my game, when you touch the ground, you lose. I want every instance of the crate to be destroyed when you lose. I imagine it is something that has to do with arrays and tags. I haven't found a solution yet though. How can I do this?
(comments are locked)
|
|
There is this function:
You can use it to get an array of GameObjects that share the same tag. Then you can iterate the array and delete them.
(comments are locked)
|
