Conditional

Conditional tasks are designed to check the game state. Examples include checking if the target is visible, is within a specified distance, or if the agent has ammo for a certain weapon. Conditional tasks can return a task status of success or failure. Conditions cannot run over multiple ticks and should return a success or failure result within that tick. One extremely useful property of conditional tasks are that they can be reevaluated with Conditional Aborts.

When Behavior Designer adds an Conditional task it will add the Stacked Conditional task. This task allows you to add multiple tasks within the same node. This is for convenience and within the Stacked Conditional you can specify if the stacked tasks should be traversed using a Sequence or Selector logic. If the task implements the Conditional class then the task will be stacked.

Conditionals can also be independent such as this Wait task. All Entity tasks must be independent, or GameObject tasks can implement the ConditionalNode class to prevent stacking. If the task has a green border then it is an Entity task and takes uses the DOTS implementation.