---
title: behaviorTree
framework: realitykit
role: symbol
role_heading: Instance Property
path: realitykit/behaviortreecomponent/behaviortree
---

# behaviorTree

Accesses the current behavior tree. Note that setting the behavior tree to a tree not in availableBehaviorTrees will add a uniquely-named entry for the tree in availableBehaviorTrees.

## Declaration

```swift
var behaviorTree: BehaviorTreeResource? { get set }
```

## See Also

### Accessing behavior trees

- [availableBehaviorTrees](realitykit/behaviortreecomponent/availablebehaviortrees.md)
