Download

Sound blueprint issues :\

I’m trying to make a sound play when the AI spots the player and chases him and stop when the AI returns to patrolling (like in Amnesia or SOMA), but im having serious trouble with it. No matter what i do, it won’t work, it either won’t play, or just start playing as soon as the level begins, or the sound keeps repeating on top of itself making it sound like a mess. It’s just driving me insane. Been at it for days and tried dozens of different ways and can’t figure it out.
Is there a simple way to make this happen?
I’d really appreciate some help with this.
Thanks.

Check if Auto Activate is enabled in the Audio Component properties.

Could you post your actual code and describe what is actually happening?

I turned off auto activate from the start, so that’s not the issue. I’ll post a picture of the blueprint when i get back home. I got it somewhat working but it’s “ugly”. The fade out works well, but the fade in won’t work at all. But like i said it’s a clunky and messy solution so far. I’ll post a screen later.
Thanks.

Actually, here’s a a screen of my chase BP on the AI pawn.
So the solution i got so far was add the sound cue to the AI BP and link the sound to fade in and play at the end of the “set max walk speed = 360”. it either starts playing full audio or fades in, gets cut off and fades in again (i think this happens because the pawn sensing action updates every 0.5 seconds). If i expand the pawn sensing update time the AI becomes really slow at response and weird.
Than i added a fade out of linked to the same sound cue at the end of “set max walk speed = 150”. At this point the AI returns to patrol mode and this works well enough.
Just can’t get the fade in to work properly when it starts chasing. but like i mentioned i feel this is a really weird and clunky solution. If you have any other ideas of how to make this work i’d appreciate it very much :slight_smile:
Thanks again
Untitled-1.jpg

OMG i think i got it to work the way i wanted to. It’s still a bit of a mess to look at, but it works. The sound fades in and loops properly when the AI starts chasing the character. No more getting cut off because the pawn sensing keeps updating and restarting the sound fade. And the sound fades out as the AI returns to patrol mode. Adding a gate, a branch and a couple of sequences to split the signal seemed to do the trick. Here’s a screen of the changes i made for anyone else interested.
fb2aa2f8efec4cf17ddfaa078d90d527391fa05b.jpeg

Nice! Congratulations. I would say you could use the DoOnce node for playing the sound cue, it could be a cleaner solution. Will be similar to the gate in this case, but would save some nodes.

i’ve been using do once nodes for trigger volumes mostly. but i’ll give it a try. but won’t the do once node stop the sound from playing ever again unless you restart the level?