- Home /
Question by
iGreyHound · Jun 12, 2017 at 09:07 AM ·
2d game
Destroying objects in a set order
So I have this one problem on my 2D clicking game.
For example: https://gyazo.com/b25753e3ca5da53cf7957fe8a91609c2
When I press object Nr. 1 it get's destroyed
If I hit Nr. 2 - nothing happens while Nr. 1 is there.
If I hit Nr. 3 - nothing happens while Nr. 3 is there.
private GameObject Item;
void OnMouseDown()
{
if (Item.gameObject.tag == "Button1")
{
Destroy(gameObject);
}
}
I tried to give these objects tags, but it doesn't seem to work and I can't find a way to make it work. Maybe someone could help me with the code?
Comment