Switching States

After creating the state nodes, establish the relations between states to develop a self-behavior change.

  1. Idle for a certain time: Switches state from Idle to Wait (self-behavior).
  2. User interacting on the Chat: Switches state from Wait / Idle to Listen state (external interference).
  3. After speaking: Switches back to Listen state (self-behavior).

Follow the instruction below to make a switch between state nodes in the Behavior Tree.

  1. In the Behavior Tree graph, right-click on the empty area and select Leaf > State > Switch State.
  2. A Switch State node is created.


    Select the node to show its corresponding settings in the Parameters section on the right.
  3. Select the target state from the drop-down list.
  4. Connect it to a state node (Idle in this case) to make the node switch to Wait after being idle for a certain time.
  5. Repeat the steps described above for state switching.

    * Switching to the Listen or Speak state requires a conditional mechanism.
  6. Deploy Test Tasks to simulate the character's behavior.