Skip to content
TA-AGSTPublic

About

Unity enemy AI with sight, hearing, NavMesh patrol and a state machine

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Enemy AI

Enemies with sight, hearing and a state machine, made in Unity (URP) with NavMesh. The arena has cover, a doorway and patrol routes.

Note: Logic build mein AI ki help li gayi hai.

Controls

Key Action
W A S D Move
Shift Run (loud)
C Crouch (quiet)
Space Jump
Left mouse button Shoot (very loud)
R Reload (or try again after dying)
T Restart the arena

How the enemies think

Patrol -> Suspicious (?) -> Investigate -> back to Patrol Patrol -> sees the player long enough -> Chase -> Attack Chase -> loses the player -> Search -> back to Patrol

  • Sight: a view cone with a line of sight check. It needs a moment to be sure (awareness grows faster when you are close). Very close, it notices you even from behind.
  • Hearing: running, walking and shots make noise (Noise). Walls make the noise quieter. Enemies walk to the place they heard it.
  • Allies: an enemy that spots you or gets shot alerts the enemies near it.
  • Two kinds: a melee grunt (wind-up before the hit, so you can step away) and a shooter that fires from a distance with some spread.
  • Headshots do more damage. Every enemy shows its state and health above its head.
  • Select an enemy in the Scene view to see its view cone.

Run it

  1. Unity 6000.3.25f1 (Universal 3D / URP).
  2. Open Assets/Scenes/SampleScene.unity and press Play.

About

Unity enemy AI with sight, hearing, NavMesh patrol and a state machine

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages