I’m trying to use a For Loop to play an audio cue 3 times.
When I tried this, the sound would play all at once, i.e. it almost sounds like three people saying the sound cue at the same time.
So I added a delay node after the sound cue, and the sound cue only plays once and stops.
Is there a way to play a sound cue for limited number of times, such as three or four times and then stop?
Right now, I have a ForLoop with the Loop Body execution pin attached to the “Play Sound at Location”, with my indices marked at First Index= 0 and Last Index = 2.
I came up with two ways you could do this. The first way I like more because it provides more control.
An event (I’m using begin play for simplicity) fires a Do N node with N being how many times you want it to play, then you save the count to a variable, play the sound, delay as long as you want the time between sounds to be, check if the count equals the amount of times you want to play, if so, call a custom event to reset the Do N node, if not, loop back to the Do N enter.
The second way I do not like as much, because you need to account for the timer not firing immediately. Again, begin play starts a timer and saves the timer handle. The timer calls a custom event every second (Time with Looping Checked), it increments a count variable, plays a sound, checks if count is equal to the amount of times you want to play, if so, clear the timer, if not let the timer run. I called play sound before setting the timer because the timer will not fire immediately but wait for the time you enter to elapse before starting.