Learn by doing
Learn Behavior Trees and State Machines by building. Four short tutorials put a graph on an object in your own scene and run it, then six common behaviors show the graph shapes the sample games use.
On this page
Every tutorial here ends in Play Mode with something you can watch. Work through them in order and you will have bound a method, added modes, reached four kinds of member, and read a running graph, inside one afternoon.
New to the asset? Start here explains what it does for a game before you install anything.
Tutorials
Section titled “Tutorials”- Your first behavior tree: one node calls a method on your own component and an object crosses the scene.
- Your first state machine: that object gets two modes and hands off when its work finishes.
- Your first binding: a method, a property gate, an event wait, and a message, on twenty lines of C#.
- Watch it run: Live colors, the values behind a decision, pause and step one follower.
Common behaviors
Section titled “Common behaviors”Six graph shapes lifted from the sample games, each naming the graph file it comes from.
- Patrol and chase: the urgent branch wins and the routine one waits.
- Guard and investigate: a noise interrupts a patrol and gets looked at.
- Attack with cooldown: the attack branch gates on a timer your code owns.
- Director with weighted choices: a wave picks its flavor by weight.
- Catch-up pressure: a rubber band that stays readable.
- Mode switch with an inner tree: a whole tree living inside one state.
The ideas behind the tutorials
Section titled “The ideas behind the tutorials”- Behavior trees: results, ordering, and what a node reports.
- Reuse a branch: one graph composed inside another.
- Blackboard: where a graph’s values live.
- Bindings: how those values reach the code you wrote.
- Faults: what happens when a bound member throws.
- Runtime: which host a graph is heading for, GameObject or entity.
Then go wider
Section titled “Then go wider”- Guides: one page per feature, with the failure modes.
- Node reference: every node, its result contract, and its parameters.
- Sample games: four playable projects to read and steal from.