Documentation 📖

Your guide to using NodeCanvas in Unity

State Machines

States

An FSM contains a finite number of states where the FSM can be at any given time. Each state performs a certain task or a number of Action Tasks for as long as it is active. While a state is active, all of its outgoing Transitions are evaluated either per-frame or once after the state is finished, and as soon as either of those conditions is true, that transition takes place and as a result, the current state is disabled and the new state is enabled. Only one transition can take place within one frame.

Transitions

Every State in an FSM can have outgoing transitions. In NodeCanvas, transitions are condition-based which means that each transition evaluation is based on one or more Condition Tasks that can be assigned to that transition. Alternatively, a transition without any conditions assigned is what is called an “OnFinish” transition, which as the name implies, will hold true only after the state has finished. When you have multiple outgoing transitions in a state, you can prioritize the order in which they are evaluated through the state’s inspector GUI. This is obviously important since only one transition can take place at a time. By default, transitions are evaluated per-frame, but there is also an option to only evaluate transitions after the state is finished. The option to choose between one or the other can be found in the state’s inspector GUI, respectively named “Check Continuously” (the default) and “Check After State Finished”.

Stacked Transition Calls

NodeCanvas also has a feature called stacked transition calls. Stacked transitions are a way to minimize the transitions required when in need to return back to some previous states after something else takes place first. Any transition can be set to be “Stacked”. What this means is that when the stacked transition takes place, the FSM will push the current state (the transition’s parent state) to the stack so that it is possible to return to it later. But when? A return to it will basicaly happen when another state in the FSM has finished and no transitions were performed when it just did. So that means that either A) That other state has no outgoing transitions at all, or B) All transition conditions of that other state when it finished were false.

Each time this happens, the FSM will return to the most recently stacked state and of course remove it from the stack (Pop). So naturally, it is possible to have multiple stacked transition calls in the FSM and in the same “flow”, where each one is pointing back to its parent state and depending on the conditions assigned (whether they are true or false when a state finish as explained above), possible to eventualy even return back to the first stacked state without any actual transitions created between the states in the FSM as far as returning to them goes.

Finally, and as far as stacked transitions calls go, a transition can be set to be “Clean”, which will basically clear the whole stack when it takes place which is useful if we no longer need returning to any of the previously stacked states.

Further Reading

Here are some interesting links on the net regarding State Machines:
TutsPlus

Yes No
Last updated on February 22, 2026
Suggest Edit

© Paradox Notion 2014-2026. All rights reserved.