If you want to stop a sound from playing have it in a rule that when true it runs the Play Sound behavior (w/o the Run To Completion selected.) Making that false will stop the Play Sound behavior if it was playing.
use Booleans for true/false attributes? Attach the sound to an image either outside the game area or inside, it will give you more control. Can you take a screenshot and post it
Comments
there should be a behaviour to pause the music. But if its a sound, then you will need to set up some rules. Music and sounds are treated differently.
Yeah it is a sound, any idea what rules I need to set up?
Thanks.
If you want to stop a sound from playing have it in a rule that when true it runs the Play Sound behavior (w/o the Run To Completion selected.) Making that false will stop the Play Sound behavior if it was playing.
Thank you again for the suggestion,
I have tried this by setting up a rule as follows;
if game.playsound = true do playsound
When you click pause;
change attribute game.playsound to false
Pause Game show scene Pause Menu
When you click continue;
change attribute game.playsound to true
Unpause Game
Yet the sound will not start to play again.
use Booleans for true/false attributes? Attach the sound to an image either outside the game area or inside, it will give you more control. Can you take a screenshot and post it
I've managed to get it to work,
I had to add a timer into the pause rule
when you click pause;
change attribute game.playsound to false
timer after 0 seconds
Pause Game show scene Pause Menu
for some reason it wont work without the timer.
I am using booleans and the sound rules are located in the Hud actor.