Performance and Troubleshooting

Establish correct candidate filtering and scene registration before increasing range, cast size, or update frequency.

Performance and consistency

  • Filter candidates before increasing cast size or range.
  • Stagger slow-changing sensor intervals so a crowd does not perform every query on the same frame.
  • Register only stimuli that matter to gameplay.
  • Keep manager and emitter lifetimes explicit in additive scenes.
  • Enable debug drawing on a small number of agents so the relevant result remains readable.

Verify in Play Mode

  1. Select the sensing agent and enable relevant debug drawing.
  2. Move a valid emitter or target from outside range to inside it.
  3. Confirm distance, field of view, and obstruction results change as expected.
  4. Watch the behavior tree and verify task status changes at the same moment.
  5. Repeat after a scene transition or emitter disable when those lifecycles occur in the game.

For Visibility, green means visible. Red, magenta, cyan, and yellow identify range, horizontal field-of-view, vertical field-of-view, and obstruction failures.

A valid object is never considered

Check Detection Mode first: Object, Object Array, Tag, or LayerMask. Then confirm cast layers include the target and the origin does not begin inside an unintended collider. Expanding range cannot fix an excluded candidate.

A value flickers near a threshold

Separate the threshold used to enter a behavior from the threshold used to leave it, or require stability for a short time. Also inspect noisy origins, offsets, and rapidly changing input values.

An emitter works in one scene but not another

Verify the required manager exists after the transition and the emitter registered with that instance. For additive loading, check the enable order of managers, emitters, and agents.

Follow Trace Trail detects but does not move

Confirm the Movement Pack is installed, the task uses a pathfinder compatible with the agent, trace points fall inside manager bounds, and those points are reachable on navigation data.

Visibility reports the wrong failure

Tune the checks in order: range, horizontal field of view, vertical field of view, then obstruction. Confirm origin and target offsets represent visible points rather than feet-level pivots or positions inside colliders.