Author Topic: Authoring Custom Actions  (Read 2730 times)


  • Administrator
  • Hero Member
  • *****
  • Posts: 2484
  • Yup.
    • View Profile
    • Cleverous
Authoring Custom Actions
« on: March 06, 2015, 09:22:17 AM »
There are often questions about making your own custom actions. You'll need a basic understanding of C# typically as this is what we use in all of the official actions but you could author them in any of the supported Unity languages if you have a better understanding of them.

You should take a look at the Wiki section for writing custom actions:
Writing Custom Actions (Wiki)

It includes a JS example, a lot of good information, tips and core ideas.

Here is an example of the UI Hints / Action Attributes (Wiki) and how to use them:
Code: [Select]
// (c) Copyright HutongGames, LLC 2010-2015. All rights reserved.

using UnityEngine;

namespace HutongGames.PlayMaker.Actions
[Tooltip("UI Hint Examples.")]
public class UIHintExamples : FsmStateAction
[RequiredField] // this is a required field, you have to put something in it.
[CheckForComponent(typeof(Rigidbody))] // tells the ui to look for a type of component, like a Rigidbody.
[Tooltip("The GameObject you want.")] // basic tooltip for hover descriptions.
public FsmOwnerDefault gameObject; // FsmOwnerDefault uses the owner GameObject as the variable.

[ActionSection("  UI Hints")]

[UIHint(UIHint.Layer)] // Use on an integer field for a Layer popup button.
public FsmInt layerSingle; // Not an array, single choice.

public FsmInt[] layerMulti; // As an array, this allows for multiple layer choices.


[Tooltip("The name of the Behaviour.")] // See Enable Behavior
public FsmString behaviour;


[Tooltip("The name of the coroutine method.")] // See StartCoroutine
public FunctionCall functionCall;


[Tooltip("The name of the script.")] // See AddScript
public FsmString someString;


public FsmString someTagSingle; // See SetTag

public FsmString[] someTagMultiple;

[ActionSection("Text Area")]

public FsmString textArea;

[ActionSection("Description Area")]

[UIHint(UIHint.Description)] // Use on a string field to format the text in a large readonly info box.
public string descriptionArea;

[ActionSection("Comment Area")]

public FsmString commentArea;

[ActionSection("Basic Variables")]

[UIHint(UIHint.Variable)] // Use on an Fsm Variable field (FsmFloat, FsmInt, FsmBool...)
public FsmFloat numbers;

public FsmBool boolean;

[ActionSection("Animation Hint")]

public FsmString animation;

public override void Reset() // the Reset area defines the default values for your action variables.
gameObject = null;
someTagSingle = null;
someTagMultiple = new FsmString[2];
textArea = "Regular text area";
commentArea = "Stuff, comment stuff.";
descriptionArea = "lorum ipsum bippity bop doo dah lorum ipsum bippity bop doo dah lorum ipsum bippity bop doo dah lorum ipsum bippity bop doo dah lorum ipsum bippity bop doo dah lorum ipsum bippity bop doo dah";
layerSingle = null;
layerMulti = new FsmInt[3];
numbers = 14.3f;
boolean = true;
animation = null;


public override void Awake()


public override void OnEnter()


public override void OnFixedUpdate()


void DoLook()


If you have other questions regarding writing custom actions or suggestions about new formatting attributes, feel free to post them!