Overview

State Designer is a visual finite state machine tool built for creating structured, state-driven gameplay systems in Unity. It provides a powerful and intuitive interface for building state-based logic such as gameplay flow, boss phases, animation control, and mode switching. State Designer focuses specifically on state control and execution flow. Instead of continuously evaluating decisions, state machines organize behavior into distinct modes and define explicit transitions between them. This makes systems easier to reason about, debug, and maintain as projects grow in complexity.

This guide provides a general overview of all aspects of State Designer. If you are new to finite state machines, we recommend reviewing the “What is a Finite State Machine?” page first to understand the core concepts of states and transitions. You do not need to know the underlying implementation details of finite state machines in order to use State Designer effectively, but it is helpful to understand the key concepts of states, transitions, and transition conditions.

You can open State Designer from the Tools -> Opsive -> State Designer -> Editor toolbar. When State Designer Pro opens you’ll see this window:

There are four sections within State Designer. From the screenshot below, section 1 is the graph area. It is where you’ll be creating the state machines. Section 2 is the inspector panel. The inspector panel is where you’ll be editing the state field values or creating new variables. Section 3 is the state machines operations toolbar. The final section, section 4, is the debug toolbar.

Section 1 is the main part of State Designer that you’ll be working in. Within this section you can create new states and arrange those states into a state machine. To start things off, you first need to add a State Machine component. The State Machine component will act as the manager of the behavior tree that you are just starting to create. You can create a new State Machine component by right clicking within the graph area and clicking “Add State Machine” or by clicking on the plus button within the operations area of section 3.

Once a State Machine has been added you can start adding states. Add a state by pressing the space bar or right click within the graph area and select “Create State”:

Once a state has been added you’ll see the following:

In addition to the state that you added, the Start event also gets added. The Start event acts as the root of the graph. The Idle state has a green border because it is a pure ECS task. Now that we’ve added our first state lets add a few more with some transitions:

You can connect the Idle and Patrol states by dragging from the slot of the Idle state to the Patrol state. Repeat this process and connect the Patrol to Log, and Log to Idle. If you make a mistake you can select a connection and delete it with the delete key. You can also rearrange the tasks by clicking on a state and dragging it around.

State Designer will execute the states based on the conditions of the transition. By default the State Finished condition is added to a new transitions which will only trigger when the originating state finishes its execution. Let’s change this so the Idle to Patrol transition triggers after a set amount of time. We can do this by adding the Timer condition:

The Timer condition will trigger the transition after the specified duration. With this transition the state machine will then be in the Patrol state. Patrol never finishes so we need to use a different condition from the default. Let’s use the Is Mouse Button Down condition. This condition will trigger when the mouse button is down. This transitions the state machine to the Log state, and for the Log state we can leave the transition to Idle at the default of State Finished. With this setup we will have the following execution order:

Idle -> Patrol -> Log -> Idle

Now that we have a basic state machine created, lets modify the parameters on one of the state. Select the Log node to bring up the Inspector for that state. You can see here that we can rename the state or add a comment. We can also modify all of the serialized variables that the node contains. This includes assigning variables using the SharedVariable system. In our case the only serialized variable is the Text. The Shared Variables panel on the bottom left allows you to create variables that are shared between tasks, GameObjects, scenes, or projects. The Elements Inspector panel and the Shared Variables Panel can be rearranged and resized.

The top section within the State Designer window is the operations toolbar. The operations toolbar is mostly used for selecting behavior trees as well as adding/removing behavior trees. The following operations are labeled:

  • Label 1: Navigate back from the last behavior tree that was opened.
  • Label 2: Navigate forward to the next behavior tree that was opened.
  • Label 3: Lists any GameObject within the scene that has the behavior tree component added to it.
  • Label 4: Lists any behavior trees that are attached to the GameObject that is selected from label 3.
  • Label 5: Exports the behavior tree to a Subgraph ScriptableObject.
  • Label 6: Opens the find dialogue which can search your behavior tree.
  • Label 7: Keeps the current behavior tree active even if you have selected a different GameObject within the hierarchy or project window.

You can find the preferences for State Designer within the Unity Preferences window. From here, we recommend that you take a look at the New Action page if you’re interested in adding your own logic. The Conditions page goes into more details on how the transition system works. Finally, the variables page is the last page that we consider necessary when working with State Designer.