Skip to main content

Evaluating Conditions in the Global State Machine

In this page, some things to note when Condition Behaviors are attached to the State Machine are discussed. 

In the Global State Machine, when there is a condition set, please make sure that the behavior triggering the event/value is set to "Bubble" Dispatch Strategy. This ensures that the event will reach the Global State Machine. Otherwise, if set to the default "Direct" Dispatch Strategy, only the behaviors of the node will receive the event. Therefore, the Global State Machine conditions may not be evaluated. This also applies to behaviors whose values are set via databinding.

For Example:

If the Global State Machine has a "Check Processed Value", make sure the Value behavior is set to Bubble Dispatch Strategy. If it has "Check Animation State", make sure that "Configure and Play Animation" is set to Bubble Dispatch Strategy.

For more information about Bubble Dispatch Strategy, check out the page Event Dispatching Strategy for details.

Bubble_databinding.png

Note that this also applies to values with data binding. If a condition in the state machine checks values from data binding set in a behavior, make sure that behavior has "Bubble Dispatch Strategy". 

Exceptions:

Conditions that involve "touch" such as "Check Hover" or "Check Click" are automatically evaluated in the Global State Machine since the touch session actually sends an event via "Bubble" Dispatch Strategy that reaches the Global State Machine. 

It is also the same for timers, which is triggered by "Start Timer" behavior. The timer event is automatically sent via "Bubble" Dispatch Strategy that's why it is evaluated automatically in the "Check Timer" condition in the Global State Machine.