XESOFT Explore Argus
Unity enemy AI mechanic / 5 sec

Unity Stealth AI: Crouching to Break Line of Sight

Watch a crouching player lower the visibility sample used by a Unity guard so half-height cover cleanly blocks line of sight without changing colliders.

Published May 26, 2026Video 2 of 10By XeSoft
01

What this clip demonstrates

  • Standing and crouching can expose different visibility sample heights.
  • Existing cover geometry performs the occlusion work.
  • The player controller only needs to publish the current posture.
02

Implementation notes

Testing visibility against the character pivot often produces unfair results because the pivot stays near the feet while the visible body changes height. A dedicated visibility sample lets the stealth controller describe the posture that the guard should try to see.

In this clip the crouch state lowers that sample behind a half wall. The guard ray then hits the wall before it reaches the player, so sight is lost for a reason that matches the image on screen. No animation-specific coupling or extra crouch collider is required.