- Home /
Destroy just the last child from a parent after the child hit a trigger
Hi I´m trying to recreate a GuitarHero like game where the "Notes" are children of a parent, that controls the movement of the "notes". So the thing, that should happen now is, that when a note enters a box collider 2D, the box collider is set to active, which is one condition to destroy the note. The second one of course is the condition of pressing the right key. BUT When there are two notes which are very close together(to make the gameplay a little more exciting) , the BOTTOM note should be destroyed even when the second note already entered the BoxCollider2D.
I hope its clear what I am trying to achieve.
I dont have any code to present because I restartet this whole idea about three times because it didnt work how I wanted it to. Does someone have an idea how to do it correctl?