State Machine
Prototype interactions without code by creating and connecting different states.
States and the State Machine
Adding and editing states [missing assets]
Open the State Machine panel
Select the State Machine button in the bottom bar to open the panel.
Select the desired object
Select the object that will be made stateful. Do this by clicking on the object in the Hierarchy or directly in the scene.
Observe that every object always contains two State nodes:
The starting point when events should occur in a specific order.
For example, if a sphere should grow every time you click on it.
Add a new State to the object
Press the + New State button in the State Machine panel to add a new State to the selected object.
Editing States
Confirm that the State you wish to change is visible and selected in the State Machine panel, then make changes to the object. The all changes save to the selected State automatically.
[gif]
Changes to Geometry made in Edit mode will propagate to all States, not just the State it was made in.
Changes made to the Base State will apply to all States, unless they’ve already been overridden.
For example, if an object is changed from white to red in Base state, it will be red in State 1, unless it’s specifically changed to be another color in State 1.
Adding transitions between States [missing gifs]
Activate and drag arrows between States to create transitions between them.
-
Hover over the State the object should start at / transition from
-
Wait until a dot appears near the State
-
Select the dot and drag towards the State the object will transition to
-
Release when hovering over the State the object will transition to
-
Use the popover to define which event and object will trigger the transition. For example, if the transition should happen when you click on an object (ex. Box), select the event On pointer down and the trigger object Box.
[gif 1] [gif 2]
Renaming States
Go to the State Machine panel, double-click on the State’s name, and type the new name.
Multi-select for State Machine [missing video]
It’s possible to add or edit states and interactions across multiple objects at the same time. To do so, select multiple objects and follow the process to add or edit states outlined above.
[asset]