Stop sound if actor touched
Hi guys
I have a pulse actor which pulses with a playing looping sound. Now when the pulse circle is touched another sound is played to show it has been pressed but the original pulse sound effect is still playing.
How do you tell GS to stop playing a sound?
There are lots of things to stop music but not a looping sound effect.
I've even tried turning the sound volume to 0 when actor is pressed but the original 'Play sound' when the scene loads up is still playing
Any clues?
Thanks guys
I have a pulse actor which pulses with a playing looping sound. Now when the pulse circle is touched another sound is played to show it has been pressed but the original pulse sound effect is still playing.
How do you tell GS to stop playing a sound?
There are lots of things to stop music but not a looping sound effect.
I've even tried turning the sound volume to 0 when actor is pressed but the original 'Play sound' when the scene loads up is still playing
Any clues?
Thanks guys
It takes a Zombie to know a Zombie!!!
Comments
make an attribute called stopLoop, make it a boolean and set it to false
In your play sound behavior, put it in a rule when attribute stopLoop is false
then when you want that sounds to stop just change attribute stopLoop to true
cheers
Done that but it doesn't seem to work...?
Do I put these rules within the actor in GS side window (EDIT MODE) or in the actor on the game screen?
It takes a Zombie to know a Zombie!!!
It takes a Zombie to know a Zombie!!!
Rule: when
Event: touch is pressed
--Play Sound: the other one √ Run to completion
Otherwise:
--Play Sound: the looping one
@};- MH
EDIT: the screenshots are too small to read
The trouble is he original sound effect is on a loop and it just keeps on playing, even if I put a rule in to say 'stoploop' is true
It takes a Zombie to know a Zombie!!!
if one is music:
on your pulseActor:
Play Music … select the musicFile √ Loop
Rule: when
Event: touch is pressed
--Pause Music behavior
--Play Sound
-Otherwise:
--Play Music … select the musicFile √ Loop
@};- MH
What would happen if I import the sound again as 'Music' How does GS deal with the difference.
If I import as 'Music' then I can use the STOPMUSIC attribute....would that work?
Thanks for the help MH...appreciate it and sorry to be a numpty!
It takes a Zombie to know a Zombie!!!
okay how long does the newPulse effect play?
you may need a Timer in the Otherwise:
Timer: After: duration of the newPulse sound seconds
-Play Sound: select the sound and loop
clicking 'Get Info' on the soundFile in Finder will show you the duration
===
Stop Music will work but if you restart it is at beginning of the track
@};- MH
I will try that and see if it works...
Thanks for your time and advice
It takes a Zombie to know a Zombie!!!