Running Behaviors One After Another
As explained in Behaviors Main Concepts, Behaviors can be combined together in a Behavior Graph and run one after another thanks to Behavior Triggers.
Create a simple Behavior Graph
To run two Behaviors one after another just drag-and-drop them in a Behavior Container flow.
Setup Triggers
Then configure Behavior Triggers to start and stop when needed. As explained in the Triggers Main Concepts, a Trigger can be seen as a barrier which stops the flow until a specific event happens in the scene.
With two Behaviors, several cases can be encountered:
- In this case, the first Behavior Stop Trigger is Trigger Container with a Boolean Trigger always false as root. It means that the walk Behavior will never stop, thus the run Behavior will never be played whatever its start Trigger value.
- Here the first Behavior Stop Trigger will become true during the simulation (for example when a Target has been reached). When the walk Behavior stops the run Behavior will start because its Start Trigger is true.
- Finally in this case, the first Behavior Stop Trigger will also become true during the simulation . When the walk Behavior stops, the flow will be stopped because the Start Trigger of the run Behavior is false. The flow remains stopped until the start Trigger turns true.