AI Won't Sense Hearing or Damage

Hello everyone,

I am currently having an issue where I am NOT able to get my enemy melee AI to sense either hearing or damage. I am sure that this has something to do with the AI controller. Here’s a screenshot of what I have. If anyone could give me some insight, it would be greatly appreciated!

Based on this image alone, that branch condition will always fail because of that last unconnected check, which is false by default and so the condition will fail.

1 Like

Kaldoom15,

I forgot to remove that pin before posting the screenshot. I was able to fix up the code so that the AI will react to sound now as well as sight. Now, I am trying to figure out why the AI will not react to the player when they are taking damage from the player. Here’s a screenshot of some updated work that I did in the Event Graph.

Does this event trigger ? also your image is too small I can’t see what’s going on.

Sorry for the small image. Wasn’t sure how else to take the screenshot and show all the work. But yes, the event does trigger for sight and sound but it will not for damage.

AI_DAMAGE
AI_HEARING

If the event is not trigged at all then it’s probably the way you apply damage, are using the ApplyDamage node ?

On the bullets on the player avatar’s gun, yes. Should there be an Apply Damage node somewhere else as well?

Just to make sure, you’re using this right? The regular Apply Damage node won’t work for AI perception by itself.

1 Like

I tried the Report Damage Event node on both the Bullet_BP that is causing the damage but it still didn’t trigger the AI Damage Sense.

AI_DAMAGEEVENT

Make sure your AIPerception component is added to your AI controller and not the pawn.

1 Like

It is on the controller.

That’s all the requirements, calling report damage event and of course having the damage sense added, try debugging the perception by pressing the apostrophe key and then num 4.

1 Like

It’s still not working. I have no idea why. I do have all the requirements, just not sure why they aren’t working together properly.

Could you provide a screenshot of your current setup? The one you showed above didn’t have the node connected

I was actually able to solve the problem. Turns out the AI was not sensing the projectile of the player due to the projectile being on an overlap. I had the AI setup for an Event Hit instead of an overlap.

1 Like

This one worked for me. Thank you so much, fellow Dota 2 player! :smiley:

1 Like