← Back to raylib · project planning pack

Skill · Version 1.0.0

Unity navigation and perception

Connects Unity NPC sensing and memory with reachable movement. Distinguishes requested paths from usable routes and bounds replanning so obstacles do not cause endless navigation work.

unity-npc-navigation-perception

Agents using this skill

See how it helps

When is it useful?

Use it when agents become stuck, chase unseen targets or repeatedly request impossible destinations.

What does it help you do?

  • Distinguishes pending, valid, partial and failed navigation paths.
  • Bounds replanning and assigns one movement authority.
  • Coordinates line-of-sight facts, target memory and obstacle handling.

Try asking this

A Unity guard tries to reach a player behind a locked door. Handle pending, partial and failed paths, remember the last observed position and choose a valid fallback. Open the door during the test and verify recovery without requesting a new route every frame or letting animation and navigation move the guard independently.

Detailed documentation

Read the skill’s original instructions, examples and checks in their authored language.

Details…Show less

NPC Navigation and Perception

Inspect the world and motor

Check the installed AI Navigation version, surface baking setup, agent types/radius/height, area costs, layers, links and obstacles. Identify movement authority and whether the world changes at runtime. Inspect the actual scene geometry and baked data before treating every stuck NPC as a decision-logic defect.

Navigation contracts

  • Distinguish path request, pending computation, valid/partial/invalid result, traversal and arrival. Evaluate stopping distance and movement/velocity under valid path state rather than reading a single distance property as proof of arrival.
  • Validate destinations and explicitly handle unreachable, disconnected or changing targets. Bound replanning rate and retries, with backoff and a useful fallback instead of requesting a path every frame forever.
  • Coordinate NavMeshAgent updates, custom steering, Rigidbody/CharacterController and root motion. One system owns movement; off-mesh traversal must hand authority back safely after completion or cancellation.
  • Model dynamic obstacles and crowd avoidance with the project's actual capabilities. Keep local avoidance separate from global path choice and test doors, chokepoints and moving blockers.

Perception and memory

Specify vision range/FOV, occlusion layers, hearing rules, update frequency and memory expiry. Use distance/angular filtering before expensive scene queries where appropriate. Distinguish current perception from last-known position; an obscured target should not update its remembered position through an unrelated global reference.

Budget sensor and path requests across many NPCs. Keep shared alerts explicit and limit who receives them. Handle sensor origin offsets, self-colliders, triggers and target despawn to avoid misleading line-of-sight results.

Verification

Reproduce spawn off-mesh, pending/partial paths, target behind a wall, lost target, moving obstacle, blocked link, interrupted traversal and crowd congestion. Debug-draw sensors, known positions, paths and failure reasons. Report target scene/package version, observed recovery and profiling evidence.

Reference: version-matched Unity AI Navigation and NavMeshAgent API. Use Craig Reynolds's steering paper to reason about local movement independently from action selection.

Included files 1

  • SKILL.md