How to use Behaviour Tree


Add BehaviourTree component

To use the behaviour tree you need the BehaviourTree component.

There are two ways to add the BehaviourTree component.

Create GameObject with BehaviourTree component

  • Click the Create button in the Hierarchy window or right click in the window
  • Select “Arbor / BehaviourTree”
GIF

Add BehaviourTree component to already existing GameObject

  • In the Hierarchy window, select GameObject to which BehaviourTree is added
  • Click the “Add Component” button in the Inspector window
  • Select “Arbor / BehaviourTree”
GIF

Open BehaviourTree graph in Arbor Editor window

To edit BehaviourTree You need to open a BehaviourTree graph in the Arbor Editor window.

  • In the Hierarchy window, select GameObject with BehaviourTree component.
  • Click “Open Editor” button of BehaviourTree component editor in Inspector window.
GIF

Also, if the Arbor Editor window is already open, it will switch if you select GameObjet with BehaviourTree component in the Hierarchy window.

Create Composite Node

  • Right-click the position of the graph where you want to create a node
  • Select “Create Composite” in the menu
  • Select the composite you want to create in the Composite Selection window.
GIF

Create Action Node

  • Right-click the position of the graph where you want to create a node
  • Select “Create Action” in the menu
  • Select the action you want to create in the Action Selection window.
GIF

For creating action script here

Customize ActionBehaviour

Connecting nodes

Route nodes, composite nodes, action nodes can connect parent-child relationships.

Connect to existing node

  • Drag the connection slot at the top or bottom of the node
  • Drop to the destination slot
GIF

Create a new node and connect

  • Drag the connection slot at the top or bottom of the node
  • Drop at the position in the graph where you want to create the node
  • Select “Create Composite” or “Create Action” from menu
  • Select the script you want to create with various script selection menus
GIF

Disconnect node

  • Right-click on the connection line or connection slot you want to disconnect
  • Select “Disconnect” from the menu
GIF

Changing the priority of nodes

The priority order is determined by the positional relationship of the nodes between the siblings having the same parent.

  • If you want to lower the priority, drag the node and move it to the right.
  • If you want to increase the priority, drag the node and move it to the left.
GIF

Delete node

  • Select the node you want to delete
  • Select “Delete” from the right-click menu in the graph, or press the Delete key
GIF

Add Decorator

Decorators can be added to composite nodes or action nodes.

  • Click the gear icon in the node header section or right click on the header section
  • Select “Add Decorator”
  • Select the decorator you want to add from the decorator selection menu.
GIF

For creating decorator script here

Customize Decorator

Delete Decorator

  • Click the gear icon in the title bar of the decorator or right click on the title bar section
  • Select “Delete” from the menu
GIF

Add Service

Service can be added to composite node or action node.

Since there is no built-in script in the service, it is necessary to prepare the service script beforehand.

  • Click the gear icon in the node header section or right click on the header section
  • Select “Add Service”
  • Select the service you want to add from the service selection menu.
GIF

For creating service script here

Customize Service

Delete Service

  • Click the gear icon in the title bar of the service or right click on the title bar section
  • Select “Delete” from the menu
GIF

Privacy Preference Center

Your Privacy

This site uses cookies to display contents and advertisements tailored to users, provide social media functions, measure advertisement impressions and clicks. We also gather information on users' site usage status and provide them to social media, advertisement distribution and data analysis partners. Each partner may use this information in combination with other information that the user provided to each partner or other information gathered when the user used the service of each partner.

Analytics, Ads

Close your account?

Your account will be closed and all data will be permanently deleted and cannot be recovered. Are you sure?