Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: hoyoyo80 on December 21, 2018, 04:50:49 AM

Title: Send Global Event the correct way?
Post by: hoyoyo80 on December 21, 2018, 04: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
Title: Re: Send Global Event the correct way?
Post by: agelvik on December 21, 2018, 07: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
Title: Re: Send Global Event the correct way?
Post by: LordHorusNL on December 21, 2018, 07: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.
Title: Re: Send Global Event the correct way?
Post by: hoyoyo80 on December 22, 2018, 02: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.
Title: Re: Send Global Event the correct way?
Post by: LordHorusNL on December 22, 2018, 10: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.