playMaker

Author Topic: Two 2D objects. Mousedown click order question.  (Read 5743 times)

jorgus1710

  • Playmaker Newbie
  • *
  • Posts: 1
Two 2D objects. Mousedown click order question.
« on: October 13, 2024, 04:16:14 PM »
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.
« Last Edit: October 13, 2024, 04:18:41 PM by jorgus1710 »

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15620
  • Official Playmaker Support
Re: Two 2D objects. Mousedown click order question.
« Reply #1 on: October 25, 2024, 04:37:33 AM »
Hi,

 Have you tried to implement this already or are you asking prior having tried? else what issue are you encountering when you try to do this feature?

It should be straightforward really.

-- can you detect these objects being clicked?
-- can you trigger animations
-- can you design an fsm that knows the current state of your sequence?

let me know, and well take it from there.

Bye,

Jean