Case Status
Log In


Home ยป API Reference»FsmStateAction
Community Wiki


Each FsmState has Actions it runs when active. All actions are derived from this base class.


Type Property
string Name
  The name of the action
GameObject Owner
  The GameObject that owns the Fsm that owns the action.
Fsm Fsm
  The Fsm that owns the action.
FsmState State
  The FsmState that owns the action.
bool Enabled

Is the action enabled?

Toggled in the editor.

bool Finished

Has the action finished running?

Actions should call Finish() when the action is complete.

bool Active

Is the action running?

Enabled && !Finished



public virtual void Reset()


Called in the editor when an action is added to a state or reset.

public virtual void Awake()


Called after the action is loaded. This is a good place to put expensive initialization.

public virtual void OnEnter()


Called when the state is entered.

public virtual void OnFixedUpdate()


Called by the PlayMakerFSM OnFixedUpdate method. See OnFixedUpdate in MonoBehaviour messages.

public virtual void OnUpdate()
Called by the PlayMakerFSM Update method. See Update in MonoBehaviour messages.
public virtual  void OnGUI()
If PlayMakerFSM.HandleOnGUI is false, then this is called by the PlayMakerGUI OnGUI method. NOTE: This batches multiple OnGUI calls together for better performance.
If PlayMakerFSM.HandleOnGUI is true, then this is called by the PlayMakerFSM OnGUI method. Sometimes you need to remove OnGUI calls from the PlayMakerGUI batch call, e.g., the SetGUIDepth action sets HandleOnGUI to true since it's hard to control the GUI Depth of batched GUI calls.
See OnGUI in MonoBehaviour messages.

public virtual void OnLateUpdate()


Called by the PlayMakerFSM OnLateUpdate method. See OnLateUpdate in MonoBehaviour messages.

public virtual bool Event(FsmEvent fsmEvent)
Actions have a chance to handle events before transitions are evaluated. Override this method to process an event. Return true to "eat" the event or false to let the FSM continue processing the event.
Actions that implement this method should set HandlesOnEvent to true in Awake.
public virtual void OnExit()
Called when the active state is exited.
public virtual void DoCollisionEnter(Collision collisionInfo)
public virtual void DoCollisionStay(Collision collisionInfo)
public virtual void DoCollisionExit(Collision collisionInfo)
public virtual void DoTriggerEnter(Collider other)
public virtual void DoTriggerStay(Collider other)
public virtual void DoTriggerExit(Collider other)
public virtual void DoControllerColliderHit(ControllerColliderHit collider)
These are collision and trigger events forwarded from PlayMakerFSM. See MonoBehaviour messages.

public virtual string ErrorCheck()


Called in the editor by the error checker. Use this method to validate the action settings. 

If you return an error string it will be displayed in the editor.

public virtual void OnDrawGizmos()
public virtual void OnDrawGizmosSelected()
Called in the editor. Equivalent to MonoBehaviour gizmo methods, allowing the action to use interactive scene gizmos to edit parameters.

public virtual string AutoName()


Called in the editor. Lets the action build its own name, typically including parameters so you can collapse the action and still tell what it does from its title.

See Get/Set Property and Call Method actions as examples.

NOTE: The user can turn on AutoName in the Action Settings Menu.

public virtual void OnPreprocess()


Called in the editor by PlayMakerBuildCallbacks.OnPostProcessScene.

Use this to preprocess the scene and avoid runtime work.

E.g., set the event handler callback flags (see CollisionEvent.cs) 

public Coroutine StartCoroutine(IEnumerator routine)
Call StartCoroutine to Start a coroutine in an action.
public void StopCoroutine(Coroutine routine)
Call StopCoroutine to stop a coroutine started by an action. Use the Coroutine returned by StartCoroutine.
public virtual void OnActionTargetInvoked(object targetObject)
Override this to handle an ActionTarget object being dragged into the Playmaker Editor.
This lets you do custom setup when the user drags and drops objects.


See Also

Using Coroutines in Actions

Action Attributes


Last modified on 12/9/2021 6:49 PM by User.

  • RSS Feed