1261 lines of code generated.
Day 2. I have been focusing on setting up “smart AIs”. The Enemy AI script includes features like:
- Patrolling & Wandering
- Moves between defined patrol points or randomly wanders within a set radius.
- Waits at patrol points for a configurable time.
- Detection & Awareness
- Uses a field of view (FOV) and raycasting to detect the player.
- Combat System
- Can attack with ranged weapons, with a cooldown system.
- State-Based Behavior
- Idle & Patrol: Regular movements and passive awareness.
- Chase & Attack: Pursues and engages the target in combat.
Summary:
This script creates enemies with patrolling, detection, and combat. It makes use of state machines, NavMesh navigation, and AI perception to create a basic enemy system.
