Yağız Selek
All projects

Behaviour Tree Guard · Case study

Giving guard decisions a visible structure.

A Unity guard exercise that moves patrol, chase and search choices into explicit tree branches.

Separate sensing from decisions

GuardSensors handles range, field of view and occlusion. An Update Perception node writes and preserves target and last-seen data on the tree’s blackboard. Sensing does not run a navigation action by itself.

Express transitions as branches

Chase, search and patrol are represented as separate sequences. Changing the guard’s perception changes which sequence can run, rather than hiding all of the behaviour in a single controller loop.

Compare it with direct state control

The patrol lab searches the last position tracked while chasing. This tree writes the last observed position through a separate perception node. Explicit branches make that distinction easier to find than a single loop that senses, transitions and updates movement together.

References

Implementation evidence

  • Guard behaviour tree

    Perception feeds NavMesh chase, search and patrol sequences, separating sensing from action selection.