Overview:
Shooter NPC AI adds coordinated combat behavior to ranged enemies in first- and third-person shooters, tactical action games, survival games, horror games, and wave-defense projects. A squad coordinator directs some enemies to attack while others seek cover, helping encounters feel less predictable than enemies that simply rush the player.
Enemies can strafe when they have line of sight or move into surrounding positions around their target. Developers can start or stop combat through simple calls, making the system suitable for projects that manage enemy behavior with their own state machines or behavior systems.
Features:
- Squad coordinator assigns Hold Cover, Strafe, and Surround orders on a configurable tick, set to 0.3 seconds by default.
- Configurable attacker cap limits how many enemies push the attack at once; remaining enemies hold cover.
- Surround positions are evenly spaced around the target, snapped to the NavMesh, and assigned using a greedy nearest-pair algorithm.
- Cover finding samples the NavMesh and uses raycasts to locate positions that block sight to the target; colliders on a chosen layer can serve as cover without markers.
- Enemies with line of sight can strafe along a configurable arc and range around the target.
- Spacing logic prevents enemies from choosing destinations too close to another enemy’s reserved spot.
- HasLineOfSightToTarget() provides a line-of-sight check for custom behavior transitions.
- Targets can be assigned per enemy, shared across a squad, or resolved by tag; the default tag is Player.
- NPCAnimator drives Forward and Strafe animation floats from NavMeshAgent velocity, with configurable parameter names, damping, dead zone, and speed normalization.
- Demo combat components include NPCShooter, Weapon, Projectile, and Health; Health raises Damaged and Died events, and the combat layer can be replaced.
- Ready-to-use enemy prefab includes wired AI and combat components, a pistol animation set, and a blend tree.
- Playable demo scene includes a cover arena, three enemies, a pre-baked NavMesh, an FPS controller, and a health bar HUD.
- PDF documentation includes integration examples and a per-field reference.
- Requires a baked NavMesh and a target that is assigned or resolved by tag.
- The demo scene requires the Input System and AI Navigation packages.
- Core behavior uses NavMeshAgent, NavMesh.SamplePosition, and Physics.Linecast; squad logic runs on a tick rather than every frame.
- Plain C# MonoBehaviours with full source included; no reflection or LINQ.
Platform:
Unity 6000.0.68
No reviews found!

No comments found for this product. Be the first to comment!