Player Preview Debug Gizmos And Collision Overlays
Player-preview debug gizmos visualize collision, navigation, sprite bounds, and spawn-safety queries while running preview or local runtime workflows.
How It Works
The overlay draws character bounds, collision ellipses, cached navigation rectangles, and scanned fallback hits. Cached overlays use the scene navigation collision cache when it is available. Scanned overlays query tilemaps directly when cache data is missing or stale.
Scan throttling keys the expensive fallback path by scene, generation, player position, and related overlay inputs so diagnostics stay responsive.
How To Use It
Enable the relevant debug overlay when movement, spawn placement, or collision behavior looks wrong. Prefer cached overlay results when diagnosing the runtime cache. Use scanned fallback output when the cache is missing or suspected stale.
Compare overlay output with scene navigation and tileset nav-mask data before changing movement code.
Invariants
Debug overlays must not change runtime collision state. Cache generation should explain why a visible overlay changed. Fallback scans must stay rate-limited. Player-preview rendering should call scene collision queries through the scene boundary, not duplicate collision semantics.
Debugging
Missing scenes, hidden player layers, absent root entities, stale cache generations, and overly broad scan requests are the main failure modes. If a collision issue appears only with the overlay disabled, look for debug-only state leakage.