Using conditions to control the actions graphs

In the previous sub-topic (the available actions), the conditions in actions were bypassed. In fact, every action can have a condition that controls whether the ActionManager executes the action or not. The conditions can check whether a value is one of the following states compared to another value:

  • Equal
  • Lesser
  • Greater
  • Different

There are three types of condition, as follows:

  • State condition: This checks whether the .state property of BABYLON.Node is equal to the given state. A state is a string.
  • Value condition: This checks whether a property is equal, lesser, greater, or different from a given value.
  • Predicate condition: This calls a custom method that will return true or false.

If an action has a condition, ...

Get Babylon.js Essentials now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.