So I have 2 GameObjects, and they have the exactly the same script attached to them called ‘RoomSpawner’. Via this script I want to destroy just ONE of these TWO GameObjects. How can I do this? By typing Destroy(gameObject); It will destroy 2 GameObjects :/,So I have 2 different GameObjects, and they have the same script “RoomSpawner” attached. I want to destroy one of these 2 GameObjects in this script. If i’d do Destroy(gameObject); then both GameObjects will destroy. Im confused, any ideas?
EDIT: Those 2 GameObjects are in the same positions, and I want to delete them by OnTriggerEnter2D