Behaviors Main Concepts

Behaviors are built-in and atomic actions which can be executed by an Entity (go to a target, play an animation, look at a target...). They can be combined together with Operators to create more advanced actions (this combination is called Behavior Graph). They can also be configured to start or stop when some specific events happen in the scene thanks to Triggers. Entities from the same Entity Type share the same Behavior Graph.

When an Entity Type is created, a Behavior Container is automatically created and attached to it. This Behavior Container will be used to store its Entity Type's Behavior Graph. Here what does a Behavior Graph looks like by default:

Behaviors can be added in a Behavior Graph:

When a Behavior is created, two Triggers are automatically created and attached to it: a Starting Trigger and a Stopping Trigger. Those Triggers can be configured to decide when/why does its Behavior starts and when/why does it stops:

A Trigger can be seen as a barrier which stops the flow until a specific event happens in the scene (the entity reaches a zone, the current frame is X...) and thus the Trigger returns true. The following animation illustrates how Triggers are evaluated and how the Behavior Graph is executed:

 

Behavior Operators provide ways to combine behaviors together, split the flow, evaluate Triggers to execute different branches of the Behavior Graph... The following picture gives an example of Behaviors combined with a Parallel Operator (which splits the flow and allows to run several Behaviors at the same time):