Audio trigger

So I placed a Trigger around a piano, and when I walk up to the piano I trigger the audio, how do I let the audio play through till the end without it playing again over the first one when re triggered? Every time I walk to the piano the audio just overlaps multiple times

DoOnce node :wink:

2 Likes

thank much! :smiling_face_with_three_hearts:

1 Like

Ok, So that works great, but now when I go back to the piano, it does not play again, hence the do once node. Can I get it to play every time I go near the piano?

You have to reset the do once when you walk away. Either

  1. Stop the music and reset the do once when the player walks away

or

  1. Reset the do once when the music finishes.
1 Like


Ok, so i was fiddling around and still canā€™t figure out how to place the reset node?

1 Like

Iā€™m gonna have to keep trying, that ā€œStopā€ func you got there I canā€™t find in the list

You need the right kind of variable. To get the right kind, right click on the output of the spawn and choose ā€˜promote to variableā€™.

1 Like


Ok, Iā€™m up to here now, but audio does not trigger again when walking to the piano

Nope. Please look at the picture againā€¦ :slight_smile:

Get the right variable type first. The stop event can be found by dragging from that.


Getting closer? lol

Nope, sorryā€¦ :-/

Thereā€™s nothing running the node:

image

You need this whole chunk

1 Like


Ok off to bed, Iā€™ll have to figure it out tomorrow night, thanks for all the help. I see Iā€™m just getting error now :wink:

1 Like

Try this method, it isnā€™t necessary to call more than one function to achieve what you need

1 Like


Itā€™s just the Target and Sound box I canā€™t find?

Top left, add audio component. Add sound you want to the audio component. Drag the component reference to the pin on the spawn audio node node.

Drag from that component reference, get duration, feed that to the delay

@Haanswors edited to make it clearer and add the delay also - feel free to ask again if still it making sense

1 Like

Animation
Also I would suggest you to go over the starter blueprint tutorials on the Unreal Online Learning Website, this will help you to refresh this kind of stuff.

1 Like


Thanks so much I finally got it! :wink:

2 Likes

Awesome! donā€™t forget to mark the issue as closed!

1 Like