Build a small behavior tree that writes two messages with a one-second pause between them. This is the shortest project-owned workflow from an empty GameObject to an observable Play Mode result.

Before you begin

  • Complete Getting Started and confirm that the editor opens without compiler errors.
  • Use a saved scene outside the imported sample folders.

Create the owner

  1. Create an empty GameObject and name it FirstBehaviorTree.
  2. Open Tools > Opsive > Behavior Designer > Editor.
  3. Keep FirstBehaviorTree selected in the Hierarchy.
  4. Right-click empty graph space and select Add Behavior Tree. The same command is available from the add button in the operations toolbar.

When the editor first opens without an owner selected, it asks you to select a GameObject. Selecting FirstBehaviorTree replaces this empty state with the GameObject and its graph controls.

The Behavior Designer Pro editor shows an empty graph with its inspector and Shared Variables panels.

Add the Tasks

  1. Press Space over the graph and add Sequence from Composites.
  2. Press Space again and add Log from Actions. Repeat so the graph has two Log Tasks.
  3. Add Wait from Actions.
  4. Connect the Start event to Sequence.
  5. Connect the children beneath Sequence from left to right as the first Log, Wait, and second Log.

The Task selector can be searched by name. Clear an active filter if a known Task is missing from the results.

The Behavior Designer Pro task selector is open to add a Composite task to the graph.

After Sequence is connected to Start, its missing-child error remains visible until at least one valid child is connected.

A Sequence connected beneath Start reports an error until its required children are added.

Sequence runs its children from left to right and stops if a child fails. Both Log Tasks complete immediately; Wait remains Running for its configured duration.

Configure the result

  1. Select the left Log and set its message to Behavior tree started.
  2. Select Wait and set its duration to 1 second.
  3. Select the right Log and set its message to Behavior tree finished.
  4. Open the Error Window from the status-bar error count or Tools > Opsive > Behavior Designer > Error Window.
  5. Resolve every reported missing connection or invalid field.

Selecting a Task displays its fields in the Element Inspector. The gear menu resets the selected Task, while a field’s watch icon shows its live value on the node.

A selected Behavior Designer Pro node displays its editable fields in the Element Inspector.

Verify in Play Mode

  1. Clear the Unity Console.
  2. Enter Play Mode.
  3. Keep the graph visible and watch the active highlight move from the first Log to Wait and then the second Log.
  4. Confirm that the Console shows Behavior tree started, followed about one second later by Behavior tree finished.

The tree may finish too quickly to see both Log Tasks highlighted, but Wait should visibly report Running during the delay. The Error Window should be clean before Play Mode, and the Console should contain exactly the expected tutorial messages with no new exceptions.

Make one controlled change

Change Wait to three seconds and test again. The message order should remain the same while the visible Running interval becomes longer. This verifies that the graph you edited, rather than a sample or another component, owns the runtime result.

Troubleshooting

Symptom Check Fix
The editor shows no graph. Confirm that FirstBehaviorTree is selected and owns a Behavior Tree component. Select it from the operations toolbar or add the component again.
Sequence reports an error. Check its Start connection and three child connections. Connect Start to Sequence and order the children left to right.
The Console remains empty. Check whether Play Mode is running, the component is enabled, and the first Log is enabled. Enable the GameObject, component, and Tasks, then enter Play Mode again.
The second message appears immediately. Check the Wait duration and child order. Set Wait to 1 or more and place it between the Log Tasks.
A Task cannot be found. Look for active selector filters or compiler errors. Clear filters and resolve Console errors before reopening the selector.

For additional diagnostics, use Debugging.

Continue learning

  1. Read Flow to understand why Sequence continues after success and stops after failure.
  2. Build Patrol and Chase an Enemy to add a real decision and fallback.
  3. Use Variables when two Tasks need the same target or value.
  4. Use Subtrees when a complete branch should be shared by several agents.