> For the complete documentation index, see [llms.txt](https://giantgrey.gitbook.io/databrain/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://giantgrey.gitbook.io/databrain/add-ons/logic/finite-state-machine/create-custom-actions.md).

# Create custom Actions

To create a custom FSM action, simply right click in the project view and select:\ <mark style="background-color:orange;">Create / Databrain / Logic / New FSM Action node</mark>

A new node class will be created which looks like this:

```csharp
using System;
using Databrain.Logic.Attributes;
using UnityEngine;

namespace Databrain.Logic.StateMachine
{
    [NodeTitle("MyStateAction")]
    [NodeCategory("StateMachine/States")]
    [NodeOutputs(new string[] {"Next"})]
    [NodeDescription("This is a node description")]
    [NodeSize(260, 100)]
    [NodeColor("#C2FAFF", new string[]{"#74AFE0","","",""})]
    [NodeIcon("fsmAction.png", "LogicResPath.cs")]
    [NodeInputConnectionType(new Type[] {typeof(Actions)})]
    public class MyStateAction : StateMachineActionNode
    {

        public override void OnEnter()
        {
            // On Enter
        }

        public override void OnExit()
        {
            // On Exit
        }

        public override void OnUpdate()
        {
            // On update is called by the state machine controller node on every tick
        }   
    }
}
```

As you can see, the class has some node attributes like: NodeTitle, NodeDescription and NodeColor. To know more about NodeAttributes please read: [Node Attributes](/databrain/add-ons/logic/custom-nodes/node-attributes.md)

The body of the class contains three methods: OnEnter, OnExit and OnUpdate.\
This is where you can add your code.

* OnEnter: Is called when entering the state
* OnExit: Is called when exiting the state
* OnUpdate: Is called on every tick by the FSM Controller
