โ๏ธ ZionRPG
RPG Framework ยท RPGFramework Namespace ยท Unity 6
Enemy AI โ Phase 9
The enemy AI system provides a state machine-based controller for NPC enemies, with support for patrol routes, player detection, and combat.
EnemyAIController MonoBehaviour
State machine controller. States: Idle, Patrol, Chase, Attack, Dead.
| Property | Type | Description |
|---|---|---|
detectionRadius | float | Sphere radius for player detection |
attackRange | float | Distance at which attack state triggers |
patrolPoints | Transform[] | Waypoints for patrol route |
CurrentState | AIState | Read-only current state enum value |
State transition from external code
// Force the enemy into alert state
enemyAI.TransitionTo(AIState.Chase);