MANU
  • Quick Start Guide
  • Learn
    • Manual
      • Installing MANU
      • Welcome Screen
      • Workspace Modes
        • Edit Mode
        • Animation Mode
        • Game Mode
      • Scene Panel
      • Main Toolbar
      • Primitives
      • Collider
      • Lights
      • Speaker
      • Importing 3D Objects
      • Main Character
      • Camera
      • Transforms
      • Materials
        • Texture Maps
          • Difuse/Albedo
          • Alpha
          • Normal
          • Ambient Occlusion
          • Roughness
          • Metalness
          • Emissive
        • Basic
        • Matcap
        • PBR
        • Glass
        • Glow
        • Texture Tiling
        • Texture Offset
        • Cast Shadow
        • Opacity type
          • Opaque
          • Transparency
          • Cutout
      • Physics
        • Static Objects
        • Dynamic Objects
        • Kinematic Objects
        • Ghost Objects
        • Disabling Object's Rigidbody
        • Collider
      • Animation Timeline
      • Triggers
        • On Launch Scene
        • Key
        • Collision
        • Animation
        • State Machine
        • Comparsion
        • Game Flow
        • Trigger
        • Object Enabled
        • Network
      • State Machine
        • State Machine — Example
      • Game Flow
      • Prefabs and Assets
      • Gravity
      • Sky
      • Variables
        • Number
        • Boolean
        • Object
        • Tag
      • Tags
      • Lightmapping
      • Paint Group
      • Export Game & Assets
        • Export Games to MANU Marketplace
        • Export Assets to Marketplace
        • Export Game on Mobile devices
        • Export Game on disk
      • Lightmapping
      • Post Processing
        • Depth of Field (DOF)
        • Chromatic Aberrations
        • Bloom
        • Color Correction
        • Screen Space Ambient Occlusion (SSAO)
        • Screen Space Local Reflections (SSLR)
    • Tutorials
    • Formulas
    • Keyboard shortcuts
  • More
    • FAQ
    • Contact Support
    • Changelog
Powered by GitBook
On this page
  • How to create a State Machine in MANU?
  • How to work with the State Machine Window?
  • Toolbar
  • Color labels
  • Creating Transitions between states
  • Configuring a Transition rule

Was this helpful?

  1. Learn
  2. Manual

State Machine

PreviousNetworkNextState Machine — Example

Last updated 2 years ago

Was this helpful?

State Machine (from the theory of algorithms) is an abstract machine that has a finite set of states and transitions between them that occur in accordance with established rules.

The state machine can have different states, but only one state can be active at a time. There are some events that switch the transition of the state machine from one state to another. As a result, the state machine can perform different actions by changing its state.

The state machine is widely used in game development for creating game mechanics.

How to create a State Machine in MANU?

To create a State Machine in MANU, go to the Toolbar and click on the State Machine icon. After that, the State Machine will appear in the Scene Tree.

By default, the created state machine has the name State Machine, you can rename it using the right mouse button. Just click on the State Machine in the Scene Tree and select this option from a dropdown list. If you hit the State Machine in the Scene Tree, the new window will pop-up: State Machine Window.

How to work with the State Machine Window?

Let's look at the elements of the pop-up window. In the center, there are 2 states: State1 and Any State.

State 1 (with a blue icon) is the initial state of your State Machine by default.

Any State (with a red icon) – a special state that always exists. It is suitable for situations when it is needed to switch to a certain state, regardless of the current state of the State Machine. This is a faster way than adding an outgoing transition to each state.

Sometimes it is needed to configure transitions from all states to one. For example, when the Main Character dies, he can die being in any state. Death can occur when he is sitting or running, etc. In this case, you need to set up transitions from all states of the Main Character's state machine, which is time-consuming. For such cases, MANU provides Any State, using which you need to configure only one transition.

Note: Any State cannot be the final point of the transition, i.e. the transition to “any state” cannot be used to select a random state.

The Minimize/Maximize and Close buttons are located at the right end of the title bar.

Toolbar

The toolbar is located in the upper left corner:

SELECT — using this tool, you can select state objects and move them;

STATE — you can use it to add a new state;

CONNECTOR – you can use it to create connections between states;

PAN — allows the user to quickly switch to panning the canvas. .

Furthermore, it is also possible to add a new state using the right mouse button if you first click on SELECT. You can also create a state by double-clicking on the canvas.

By right-clicking on the State, you can open the context menu with a set of actions which you can apply to the State. Using this menu, you can rename, duplicate, cut, copy, delete the state, as well as add color labels. Most of the commands are accessible via hotkeys. Furthermore, it is possible to rename the State by double-clicking on its name.

Color labels

Color labels are used to visually design transitions from one state to another, which is very convenient when a state machine has many states and connections between them. To add labels, just right-click on the State and choose the color you want to mark it with.

Creating Transitions between states

To set the connection between states, you first need to select Connector on the Toolbar. Then click on the State, from which you need to make a transition, and drag the line to another State holding down the left mouse button. For example, drag the line from State 1 to State 2.

A dotted line with an arrowhead will appear between these states. The dotted line means that the link between State 1 and State 2 has been created, but it is not configured, i.e. the rule has not been created yet. It is not described how the transition from one state to another will take place. This dotted line can be moved, its shape can be changed. All this can be done by clicking on and dragging the left mouse button. The shape of the line does not affect the transition between states. Therefore, it can be drawn in any shape.

Configuring a Transition rule

When you click on the dotted line, a Trigger Panel will appear. Using this panel, you can create a rule for the transition from one state to another. Just choose a trigger you need.

The Trigger Panel closes when you click on any area of the State Machine Window. After creating a rule, the dotted line will turn to a solid, continuous line. It means that the connection between states has been configured; and the transition rule from one state to another is established. In addition, when you hover over the line, the transition rule will be shown in the tooltip (for example, Key Down: 0).

One state can have several connection lines with other states. Multiple transitions can be made from one state, as well as into it.

State Machine in Toolbar
State Machine window
State connections
Default canvas
Pointer tool
Color labels
Color transitions between states
Connection tool
Connector edit
Transition edit
Tarnsition trigger
Connector tooltip
State Machine example