How to create an advanced enemy AI

Updated on January 6, 2018 in [A] Unity Scripting
Share on Facebook0Tweet about this on TwitterShare on Google+0Share on Reddit0
1 on January 5, 2018

How can I program an enemy AI that does not detect you when you are behind him, and can react to sounds as a possible threat?

  • Liked by
Reply
0 on January 6, 2018

When you play a sound for an object, check if the sound level is high enough so the enemy will react on that. For example shooting is lvl 1, walking is lvl 0.5, crouching is lvl 0.2 and standing still is lvl 0. Than you can specify the range for each level that the enemy can hear for each sound. Then if the sound is played, you check for the enemy if the range for the given sound is close enough and you let your enemy react on that.

 

  • Liked by
Reply
Cancel