States
A State is a stored set of properties that can be activated and transitioned to at any time through either user input, or an event within the experience. States are typically used as building blocks to transition between sets of values.
For more complex transition animations, you may want to use Timelines.
Adding a new State
The best way to add a new state is by creating it inside a Layer, although you can also create independent states if you wish.
The sections below detail how you can create a new state to add interactivity and dynamism to your Mattercraft project.
Adding a new State in a Layer
You should create a new layer if one doesn’t exist.
To add a new state in a layer:
- Click on the Animations panel to open it up
- Click on Layers if it is not already selected
- Hover over your Layer until you see the 3 interactive dots
- Go to + Add and then New State
- Type in your new state’s name and then use the State Clip editor to begin altering the value of node or behavior properties
Giving your states brief but descriptive names will make them easier to manage; particularly when activating them with Behavior Actions or script.
Adding a new State as an independent Clip
To add a new state as an independent clip:
- Click on the Animations panel to open it up
- Click on Clips if it is not already selected
- Click on the + (plus) icon and then New State
- Type in your new state’s name and then use the State Clip editor to begin altering the value of node or behavior properties
You can also add existing states to a layer at any time.
Assigning properties to a State
When you have created a state, you will want to start assigning node property values to it in order to create animation transitions.
To assign properties to a state, use the following steps:
- Find your State in the relevant Layers or Clip tab
- When you find your State, click on it and the State Clip editor will open
- Simply adjust the values of your node properties by using the State Clip editor and the Node Properties or Behaviors Panel
Activating a State
At some point in your project, you will want to activate certain states based on a specific interaction, such as user input, Raycaster events, or Trigger events.
To learn how to activate a state in Mattercraft, carry on reading our dedicated documentation:
Next article: Activating States