XESOFT Explore Argus
Unity AI field guide / Search

Last-Known-Position Search Behavior for Enemy AI in Unity

Build fair enemy search behavior in Unity using last-known positions, investigation phases, line-of-sight loss, expanding search points, squad reports, and readable AI memory.

8 minute read Updated August 14, 2026 By Xerav, creator of Argus
See the mechanicArgus: Squad Alert Propagation micro-demo
01

Move the guard using what it knows, not what the game knows

The player transform is always available to the game, but the guard should only act on information it has earned. While sight is valid, update a confirmed position. The moment line of sight breaks, freeze that position and stop steering toward the live player.

This single rule is the foundation of fair stealth search. It creates an escape opportunity and prevents the familiar problem where an enemy appears to track the player perfectly through walls.

02

Split investigation from active search

First travel to the strongest last-known position. On arrival, verify the immediate area, pause, look around, and communicate uncertainty. If the target is not found, transition into a broader search rather than returning to patrol immediately.

Different evidence can enter at different phases. A faint noise may cause only a short investigation. Losing direct sight during combat should begin a more persistent search with a larger area and longer dwell.

03

Generate search points that communicate intent

Random points inside a circle are easy, but pure randomness can look indecisive and revisit the same space. Generate a small ring or sequence around the last-known location, reject unreachable NavMesh points, and record visited locations.

Orient guards outward when they reach the ring. That produces a readable sweep, covers likely escape routes, and makes multiple guards look coordinated even when each one is following a simple assignment.

  • Bias the first point toward the direction the player was moving.
  • Avoid points that are too close to the previous destination.
  • Use NavMesh sampling before committing to a location.
  • Expire the pattern after a clear time or confidence threshold.
04

Reacquisition should replace search immediately

Any new direct sighting should cancel the old search plan, update the confirmed position, and return the guard to pursuit. New weak evidence should not necessarily do the same. Compare its priority with the current threat before redirecting the guard.

This prevents a thrown object or stale corpse clue from pulling an engaged guard away from a player it can currently see.

05

Share reports without sharing omniscience

A squad report should contain a location, confidence, source, and age. Receiving guards can converge and search that location, but the report should not become their own confirmed sighting. Only a guard with direct visual evidence should update a live target or authorize accurate fire.

If the design supports continuous radio tracking, share live positions only while at least one spotter still has a valid line of sight. When that contact breaks, freeze the last report and transition the group into a coordinated search.

06

Show the player where the guard thinks they are

A ghost marker, brief bark, head turn, flashlight sweep, or visible search path can reveal the guard mental model without exposing debug data. The player should be able to recognize that the enemy is searching the wrong location and make a deliberate move around it.

For development, show the confirmed position, reported position, current destination, search radius, remaining dwell, and the evidence track that created the search.

The production-ready path

Argus already connects these pieces.

Argus packages perception, awareness, memory, suspicion, search, squad coordination, and live debugging into a drop-in Unity 6 system. Use the included guard or subscribe to its events and keep your existing movement, animation, combat, and character art.