Good day everyone! I have a question regarding AI in Unreal Engine, I'm using behavior tree. I want that every time one of the enemy hears my character they will come to it.
What settings do I need to do with my Blueprint or Behavior Tree.
asked Dec 08 '15 at 03:10 AM in Using UE4
Hi yeeen, To allow your NPC to hear something, you can add a Ai Perception Compoennt to your AIController and add one AI Hearing config to Senses Config array.
Then, you can implement the OnPerceptionUpdated of this component and using the Get Actor Perception method get the info of the character that has maked noise. (in my example i am using 1 as index because i have two Senses config, and the index 0 is for AI Sight config). In this simple example i draw a degbug sphere in the location of the noise.
Then, your Player can generate some noise using Make Noise node.
Now, if you want that your NPC walk to the noise location, you can simply replace the debug node for a Move To Location Node or even better, save the noise location in some blackboard key and then use the behavior tree and the Move To Node.
Also, remember to add to your level a Nav Mesh Bounds Volumen because you need it for all the Move To functions of your NPC.
answered Dec 08 '15 at 04:45 AM
Follow this question
Once you sign in you will be able to subscribe for any updates here