playMaker

Author Topic: Send Global Event the correct way?  (Read 469 times)

hoyoyo80

  • Junior Playmaker
  • **
  • Posts: 86
    • View Profile
Send Global Event the correct way?
« on: December 21, 2018, 02:50:49 AM »
Hi all,

im learning how to send global event but so far i cant understand the flow.

1.I have two cube, one named sender and one named receiver
2.One fsm in sender detect mouse input to send global to the receiver FSM
3.It seem not working at all.

Please guide me:) Thanks
« Last Edit: December 21, 2018, 03:10:27 AM by hoyoyo80 »

agelvik

  • Beta Group
  • Playmaker Newbie
  • *
  • Posts: 23
    • View Profile
Re: Send Global Event the correct way?
« Reply #1 on: December 21, 2018, 05:17:40 AM »
in "receiving" fsm, replace "sending" transition with "FINISHED" (CTRL + left-click on state for shortcut) and it'll flow accordingly. the way you've set it up makes it only reach "State 2" but not further, mainly because you don't have a follow-up in this state.
example use a "wait" action, and it'll call an event transition when it reaches the desired time

i prefer to avoid using global events and instead rely on local ones to avoid making a potential mess later in development

LordHorusNL

  • Beta Group
  • Full Member
  • *
  • Posts: 164
    • View Profile
Re: Send Global Event the correct way?
« Reply #2 on: December 21, 2018, 05:35:06 AM »
Also it's better practice to use "Send Event By Name" for sending to other FSM, that way you don't have to make your events global.

You can still use "Send Event" for sending events within an FSM if you want.

Like agelvik said.
« Last Edit: December 21, 2018, 05:37:22 AM by LordHorusNL »

hoyoyo80

  • Junior Playmaker
  • **
  • Posts: 86
    • View Profile
Re: Send Global Event the correct way?
« Reply #3 on: December 22, 2018, 12:22:00 AM »
Ok...Im still digesting the feedback but thanks. I also interested with local send event between object. Care to post an example like these two cube here?

@LordHorusNL, Send Event by Name dont have to use global event for between gameobject? Thanks

Thanks a lot.

LordHorusNL

  • Beta Group
  • Full Member
  • *
  • Posts: 164
    • View Profile
Re: Send Global Event the correct way?
« Reply #4 on: December 22, 2018, 08:58:33 AM »
That's right, when using "Send Event By Name" the events do not need to be marked as global even when sending to other GameObjects.

Global events are less secure and tend to clutter up your menu, so it's good practice to use send by name in most situations.