Documentation

Learn how to use NodeCanvas

FSM Nodes Reference

States

States can have incoming and outgoing transitions. Only one state can be active in the FSM at any given time.

Action State

The Action State node itself holds an Action List. On Enter, the assigned actions will execute either in parallel or in order one after the other. This can be set in the inspector. The State is considered finished as soon as all actions are finished if at all. In Play mode the running actions will also be marked with a play icon in front of them.

  • OnEnter: All Actions listed will execute.
  • OnExit: All Actions listed will stop.
  • Finished: When all Actions listed have stopped.

You can select whether or not you want the listed actions to Repeat themselves by checking the “Repeat State Actions” options. Doing this will naturally also make the state unable to finish and will rather keep running forever. You can also set if you want the listed actions to Run In Sequence or Run In Parallel by the relevant GUI control underneath the action list as usual.

Super Action State

The Super Action State gives finer control for when to execute actions providing a different actions list for OnEnter, OnUpdate, and OnExit respectively. Do note that this state will never finish on its own if there are actions in the OnUpdate list.

  • OnEnter: The OnEnter actions will execute.
  • OnExit: The OnExit actions will execute (for 1 frame only).
  • Finished: When the OnEnter actions have stopped, but never if there are any OnUpdate actions.

Utility

Utility nodes are not states and thus can have no incoming transitions. They instead do something in parallel / at the same time with the FSM.

Any State

The Any State node is used to transition from Any State to any other state based on the conditions assigned to its transitions. It can have any number of transitions that are constantly checked. If any transition condition becomes true, the current state of the FSM (whatever that is) will Exit and the target one of the Any State transition will Enter.

You can also mark “Don’t Re-Trigger Active States”, to prevent Any State from transitioning to a state that is already active.

On FSM Enter

The On FSM Enter node holds a list of actions, as well as a list of optional pre-conditions required. The action here will execute as soon as the FSM starts if the conditions are met.

On FSM Exit

The On FSM Exit node holds a list of actions, as well as a list of optional pre-conditions required. The action here will execute as soon as the FSM stops if the conditions are met.

On FSM Update

The On FSM Update node holds a list of actions, as well as a list of optional pre-conditions required. The action here will execute in parallel with any running state of the FSM and for as long as the FSM is running if the conditions are met.

Pass

The Pass node has no functionality and is meant for organisational reasons. Contrary to using an empty state, the Pass node evaluates its transitions immediately as soon as Pass is entered.

Sub Graph States

These are considered states as normal but are in a separate category for clarity.

Sub Behaviour Tree

The Sub Behaviour Tree state is assigned another whole Behaviour Tree. On Enter, the sub Behaviour Tree will be executed either once or repeat based on the chosen setting in the inspector. If set to Once this state will finish as soon as one Behaviour Tree cycle is done. if set to Repeat this state will never finish by itself.

You can optionally specify two events to be sent, one for when the sub Behaviour Tree’s root node returns Success and another for when it returns Failure. As soon as either happens, the corresponding event will be sent to this FSM, which you can make use of using the Check Event condition on this state transitions. Remember that you can also use SubGraph Variables Mapping as with all SubGraph nodes in NodeCanvas to map the subgraph local variables to its parent graph variables.

Sub Behaviour Tree States are very powerful since you can have the broad states at a top level of the behaviour and at each state go deeper to define the behaviour of the state using Behaviour Trees.

  • OnEnter: The Sub Behaviour Tree will start.
  • OnExit: The Sub Behaviour Tree will stop.
  • Finished: Never if the Sub Behaviour Tree is set to “Repeat”. As soon as one cycle is done if set to “Once”.
Sub FSM

The Sub FSM state is assigned another whole FSM. On Enter, the sub FSM will execute. This State will be finished when and if the sub FSM is finished.

Remember that you can also use SubGraph Variables Mapping as with all SubGraph nodes in NodeCanvas to map the subgraph local variables to its parent graph variables.

  • OnEnter: The Sub FSM will start
  • OnExit: The Sub FSM will stop
  • Finished: When the Sub FSM is finished (remember that an FSM that reaches a finished state with no outgoing transitions is stopped/finished automatically)
Sub Dialogue

The Sub Dialogue state is assigned another whole Dialogue Tree. On Enter the sub Dialogue will execute. This state will be finished when the Sub Dialogue is finished.

You can optionally specify two events to be sent, one for when the sub Dialogue finish in Success and another for when it finishes in Failure. As soon as either happens, the corresponding event will be sent to this FSM, which you can make use of using the Check Event condition on this state transitions. Remember that you can also use SubGraph Variables Mapping as with all SubGraph nodes in NodeCanvas to map the subgraph local variables to its parent graph variables.

  • OnEnter: The Sub Dialogue will start
  • OnExit: The Sub Dialogue will stop
  • Finished: When the Sub Dialogue is finished, either because a Dialogue tree Finish node is used, or because it has no nodes left to execute.
Yes No Suggest edit
16 of 17 users found this section helpful
Suggest Edit