playMaker

Author Topic: Question about Global Events and Broadcast All  (Read 1413 times)

indeed

  • Junior Playmaker
  • **
  • Posts: 85
Question about Global Events and Broadcast All
« on: February 02, 2016, 07:49:36 PM »
Hi, I have an FSM attached to my camera that can detect if a mouse input is a Drag, or a Click. The output of this FSM is a "Broadcast All" Send Event that I want to use as a Transition.

The problem happens when I use this on other FSMs as a transition. I have 6 spheres that all have an "int add" action. When all 6 are detected, an Int Switch triggers another state. The problem happens when I try to use the "Click" detection to trigger the Int Add because the "Broadcast All" makes every instance of the "Click" transition fire at once. So when I click only one sphere, every sphere is activated.

Is there a way for the Click/Drag FSM to only broadcast it to the FSM where it has been called in a transition? Sorry if I'm missing something obvious about this workflow.


mdotstrange

  • Hero Member
  • *****
  • Posts: 555
    • Can't code? Who cares! Make games anyway!
Re: Question about Global Events and Broadcast All
« Reply #1 on: February 02, 2016, 08:31:25 PM »
Yes- when using Send Event to the send the event- instead of using Broadcast All- use GameObject FSM and then you can set the game object and the specific FSM on that game object you want to send the event too.
Indie game dev and instructor at the Strange School. Learn Playmaker at the Strange School!

indeed

  • Junior Playmaker
  • **
  • Posts: 85
Re: Question about Global Events and Broadcast All
« Reply #2 on: February 03, 2016, 10:27:53 AM »
Thanks for the reply! That makes sense, but gives me another question. Does that mean that for every time I call the Click/Drag FSM, I need a unique instance of that FSM pointing to the appropriate object? So I can't somehow have a single master-control click/drag fsm. I need 6 of them and each one is linked to the correct object?