I have 3 random sounds played with trigered box. And I am wondering how to prevent them to play simultaneously, becouse when you get in trigger box while one of the sounds is playing the next random sound starts playing to… Please help!
Control it from the outside. For example, to prevent a new sound to play until the end of the previous one:
Thank you, but how can I use this on my example? I am new to this…
How are you playing the sound? Are you using an audio component or are you spawning the sound?
I am using trigger box to load sound cue.
Playing the sound like that gives you no control over it once it starts. So, you have several choices. Here are a few:
- continue to use "Play sound at location " and use a timer or a delay to prevent playing another sound until the previous has finished (requires all 3 sounds to have similar length);
- use a BP with a box collider and an audio component, instead of a trigger and level BP;
- continue to use level BP and use “Spawn sound at location”:
I would go with option 2.
Can you explain step 2 please? I am new to unreal…
1 - create an actor BP
2 - add a box and an audio component:
3 - create script in the event graph:
4 - uncheck auto-activate of the audio component:
5 - create a new variable Sound Base type and add the following script to the contructor:
6 - compile and save
7 - now you can drag as many of these BP to the world and specify to each one of them the sound to play when a character collides with them:
It works! Thank you verry verry much!