Does anyone have a link to a working example on how sound can be triggered with a timed event without using an interactive button that works with Firefox? The browser stops every time i try to trigger it with any kind of timed event but works fine with interactive buttons.
I’ve tried using the timer after pressing the screen button as well with the same results the browser just stops when the timer fires.
First of all:
to play sound, a user interaction is requierd. this should stop each website from blasting sounds out without the users action!
Can you show some snipped how u try this allready?
Im using triggerd sound-effects in my game, they’re working…
setTimeout( ()=> scene.game.sound.add( "soundname" ).play(), 1000)
Final Mortal Battle Test 0.6
What i’m trying to accomplish is more than just a delayed sound but if you want to see it go there and use the right arrow key to walk over to subzero and scorpion battles. I wanted to make them produce their own sound effects such as “get over here” and iceblast contact sounds not sure how i would accomplish that with a simple delayed sound. I’ve been able to get it to play the sounds on load without any user click and do the sfx for the player abilities just didn’t figure out how to get the timer to play the sounds using the same kind of code. I will try that first example though if it can be done the way i want to be they would just make the sounds whenever the event for their move triggers via the timer which isn’t really a delayed event. It’s probably my methods though i’m still pretty new at this
I tried the code you put up and it seems to work okay.
Thanks for the help Puccini