Documentation ๐Ÿ“–

Your guide to using NodeCanvas in Unity

FSM Callbacks

When an FSM state is Entered, Updated or Exited, you can receive callbacks on your MonoBehaviours attached to the same game object as the FSMOwner. The callbacks that can be used areย the following:

  • OnStateEnter(IState)
  • OnStateUpdate(IState)
  • OnStateExit(IState)

To do so, you need to implement the ‘IStateCallbackReceiver’ interface in your MonoBehaviour. Here is a code example for your convenience.

IState is an interface having information about the current state the callback is called for.

These callbacks are not meant to be used for modeling a whole state, but rather to get notified and perform some extra actions you might need to do.

Yes No
Last updated on January 10, 2020
Suggest Edit

ยฉ Paradox Notion 2014-2025. All rights reserved.