Issues with sounds in for loops

I’m trying to compile a phrase using sound bites so that I can have an audio clip of a number without having to record every possible number. However, something strange is happening with the for loop.



Above is the code snippet I’m referring to. in the first photo, you can see the 2 arrays im using, “location sounds” and “location clip lengths”. The first holds an array of sound base object references (the sound clips as uassets) and the second holds an array of floats to keep track of how long the clip is. The arrays are compiled in the ATCALEFoundHVT function. Once i get to the for loop, i have checked and the array is compiled correctly. However, once i step to the play sound node in the loop, there is a pause where another sound, seen in the second photo way further along the blueprint, is played. Looking at the inputs to the play sound node at THAT moment, there is either “none” or the last sound in the array. i.e., its skipping forward along the blueprint and playing a different sound and skipping over all my sound plays in the for loop. Does anyone have any idea why this is happening?

1 Like

I haven’t looked at your code in great detail, but I can tell you that delay does not work in a loop.

You’ll need to make the loop ‘manually’, like this:

1 Like

that appears to have been the issue. thanks

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.