AI play sound upon seeing player BP

So I’m trying to make my AI enemy play a sound when it spots me, but when it spots me it plays the sound every fraction of a second so it just plays it over and over until it loses sight of me and the sounds start to slowly die down. I need the sound to only play once each time I enter the AI’s FOV. What am I doing wrong?! Can someone provide me with a screenshot of a corrected BP? Sorry, I’m REALLY new to UE.

Try to reset the Do Once when the Player is out of sight of the AI Character.

How would I do that? Like could someone provide an image of what that would look like in the BP?

I don’t have much experience using PawnSensing, but you could try to use AIPerception instead of PawnSensing.

I’m not at my computer atm, but I can show you how I have set it up using AIPerception in a few hours.

That would be great! I really appreciate that!

Hi, sorry couldn’t find my older AI project, but I set up a way to play sound once every time the player gets in sight of the AI Character using the PawnSensing.

The timer will reset everytime it is updated, and if the player stays out of sight for more than 1 sec the sound will play again when the player enters the AI’s sight.

It works perfectly. Thank you so much for your help!!

Glad I could help :slight_smile: