Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: MikeTelly on July 22, 2018, 06:11:27 PM

Title: Ordering with Send Event
Post by: MikeTelly on July 22, 2018, 06:11:27 PM
How exactly does ordering work once I use send event? For example if I have an FSM that sends an event and then sets the velocity of an object to 0 and in the receiving FSM I set the velocity of that object to 3, what happens?

Well it be 0 or 3, and why?
Title: Re: Ordering with Send Event
Post by: Fat Pug Studio on July 23, 2018, 01:00:21 AM
The object will have the velocity of the last event it received.

In this case, i'm presuming you are setting the variable value in FSM, and in the same time
 receiving variable value from another FSM.
Title: Re: Ordering with Send Event
Post by: jeanfabre on July 30, 2018, 06:23:18 AM
Hi,

 the the chain of actions is linked, then it will be in order.

 FSM A set v=0, sends event to FSM B, FSM B set v=3

v will be 3.

 however if the chain of event and transition is not linked, then there is no guaranteed as Unity calls Updates on GameObject in an unreliable way ( only script exscution order and affect this, but since all fsm are of the same component, that's not useful).

so the only way within a given frame to guarantee order of execution is via linked events and transitions, it doesn't matter if that chain affects multiple fsm.

 Bye,

 Jean