How can i make the sound play only once in the animation?

Hello guys,

Please forgive the newbie question , but we all have to start from something.
My question is :
I have a character that is flying (uses animations as well) , and i want to use a sound that indicates that you’re going faster, however , when i add the sound in the Notify , that sound is always looping while in the animation. To explain it better. I’m flying , i press Shift to boost , then a sound needs to go off once until i press shift to boost again , but instead , i press shift to boost , and i hear the sound multiple times.

Any help is appreciated

Bind the boost sound to the boost event (shift) … not with anim notify.

Shift pressed -> if can boost (hopefully you have can do logic) -> apply boost -> apply sound.

Worked like a charm , what if i want the sound to be at the end of an animation? Like , when i reach 1000 speed , play the sound

In that case you’d want to probably run a boolean check in your setup to see whether the player has reached that speed, after which you can trigger the sound. You can also use a timer to check if you need a more accurate count of what your speed is. Try to avoid Event Ticks. =)

Any chance i can get that explanation in a blueprint? I must be doing something wrong and instead of the sound coming at the end of the animation , it just comes up everytime i press Shift. Doesn’t matter if the character is standing still , i press Shift , and the sound pops. So basically i need to check if the speed is set to 1000 , then play the sound , if the speed is not 1000 , don’t play the sound , but i can’t seem to make it work. I’m sorry for this but i’m trying to work my way around and learn stuff.

Create a boolean variable for what you need (call it speedboost?)
off the notify, create a branch. Drag the variable to the BP and plug this boolean in.
if the boolean is false -> call the sound -> set the boolean to true.

If you want to tie it in to speed you can do the same bool>branchF>sound>set bool T
procedure, you just do it with the Speed variable in the same “sequence”.
Probably where you increment the speed.
you can tie and AND in, and check what the speed actually matches with a > 999 as the other pin on And.

Post your boostspeed code/bp. We can tell you exactly where to implement the check and sound event trigger.

That “can do logic” I mentioned previously would prevent the boost sound from play.

Press shift -> Can I use Boost?

  • true -> Apply Boost -> Apply Sound
  • false -> do nothing, or notify boost is not available.

The majority of your game logic should be “Event” based with conditional checks/balances.

Init event -> Can I Do This? (conditional logic).