https://vimeo.com/1119664530?share=copy

🧠 What’s a state machine?

A state machine is a way to describe how something changes over time based on certain conditions.

It’s like a flowchart: “If this happens → go there.”

Instead of one long animation that always plays the same way, a state machine lets you break it up into pieces (called "states") and control how and when they change.


🎮 Example 1: A Button

Let’s say you have an animated button.

With a state machine, you can say:

image.png

So now the button feels interactive — not just animated.


🚦 Example 2: A Traffic Light