2D AI Systems: FOV Detection & Archetype Behaviors in Unity

Опубликовано: 14 Май 2026
на канале: Jay Webb
36
1

This video demonstrates a modular 2D Enemy AI System and character animation framework developed in Unity. The focus of this tech demo is on distinct enemy behaviors—flying and crawling—and a customizable detection system based on mathematical triggers.

Key Technical Features:

Waypoint Navigation: Both enemy types utilize a waypoint-based movement system. The AI calculates its sprite-facing direction and transitions to the next objective once the current coordinate is reached.

Specialized Combat Behaviors:
Swoop Mechanic (Flying AI): Upon player detection, the flying enemy executes a swoop maneuver by dynamically modifying its Y-axis position through a dedicated script.

Enrage/Chase Mechanic (Crawling AI): The crawling enemy responds to player presence by triggering a speed multiplier, increasing the threat level once the player is spotted.

Designer-Customizable FOV Detection: Enemies detect the player using a two-tier check:
Field of View (FOV) Angle: A variable angle check (settable by level designers) determines if the player is within the enemy's vision cone.

Distance Threshold: A proximity check ensures the player is within a relevant range.

2D Animation Controller: Showcasing the implementation of the Unity Animator Controller, managing state transitions for the player character to ensure fluid, responsive movement visuals.