Hi! I have two 2D game objects with simple animations triggered by a mouse click. One object is in front of the other.
I want it to work like this:
- When the front object is clicked, it plays its animation.
- Once the object behind is revealed, you can click it to play its animation.
Example:
- The first object is a bush. When clicked, the leaves open, revealing a bird behind it.
- The second object is the bird, and when clicked, it flies off the screen.
Right now, even with the bush in front, clicking it triggers the bird%u2019s animation too. How can I make sure only the front object responds to clicks first, and then the hidden one responds after it's revealed?
Thanks in advance for any help!
PS: The box colliders are in place of course, and the front objects collider is bigger than the collider of the object behind it.