Getting Started
A Sense defines how an agent measures a stimulus. An emitter or scene service defines registered environmental data, and a task turns the current reading into task status or shared output.
How perception flows
Sensor
A sensor is a serialized object selected within a task, not a component to add to a GameObject. The task initializes it with the agent’s GameObject and queries it when updating. The sensor measures visibility, sound, distance, luminance, temperature, surface, or trace information without deciding the agent’s response.
Emitter or scene service
Emitters and scene services supply data for luminance, temperature, surfaces, and traces. Visibility and distance query candidates directly. Sound queries playing Audio Source components in selected candidates’ children; it requires no separate sound emitter. Configure only the data sources required by the selected sensor.
Task
A behavior-tree task reads sensor data, applies its configured detection mode or threshold, and returns Success, Failure, or output data. The surrounding graph owns memory, priority, interruption, and the gameplay response.
Choose what the sensor detects
Detection modes restrict the candidate set before the selected Sense performs its measurement:
- Object checks one assigned object.
- Object Array checks assigned candidates.
- Tag discovers objects with the configured tag.
- LayerMask discovers candidates on selected layers.
Prefer explicit Object or Object Array modes when another system already knows the candidates. Use LayerMask for environmental discovery, and keep the selected layers narrow before increasing range or cast size. For performance reasons, Tag detection is not recommended for production.
Choose the cast shape
Where supported, select the smallest shape that matches the gameplay query:
- Raycast tests a line.
- Sphere Cast sweeps a spherical volume.
- Circle Cast performs a 2D circular cast.
- Capsule Cast sweeps a character-like capsule.
- Box Cast sweeps a rectangular volume.
Larger casts find more candidates and can produce more obstruction hits. Set origin and target offsets to meaningful sensing points, such as eyes and a target’s visible center, rather than blindly using feet-level pivots.
Configure a sensor task
- Select the Sensor type.
- Choose Detection Mode and configure its Object, Object Array, Tag, or LayerMask filter.
- Configure range, cast, threshold, and update settings.
- Bind any output to a Graph variable when another task or script needs the result.

Choose update intervals from gameplay latency. Fast line-of-sight combat may need frequent checks; slowly changing temperature usually does not.
Verify the first setup
Move one valid target from outside the configured range to inside it while watching debug output and task status. Establish one sensor and task independently before combining multiple senses.