On touch, play sound and change scene - sound won't play
Hi All,
I am making my way through several youtube tutorials and find that I have issues that the instructor does not, which makes it challenging to learn, My current issue that I would like some assistance with is this.
I have an actor that is a button that when pressed should go to the next scene and play a sound. My backstage is as follows:
ON RULE,
When ALL of the following are happening
touch is PRESSED
DO
ON Play Sound
play sound (sound name) with run to completion ticked
at volume 3
at pitch 1
ON Change Scene
go to: (new scene).
If I set the change scene to OFF the sound plays without issue. As soon as I enable the change scene there is no sound. I have tried different orders to no avail and it is exactly like the tutorial.
Am I going mad?
Greg
Comments
You could try slightly delaying the scene change with a timer to set of the sound before the scene changes.
When pressed
Play sound
After 0.1 secs
Change scene
www.rossmanbrosgames.com
the problem is that it is only "pressed" when the touch is down so the sound must be checked 'run to completion'.....it's better to use an attribute system and then have a rules actor that plays all sounds and handles other fuctions
Hi Pointing,
I don't know about previous versions of Windows Creator or the current version of Mac Creator, but in Windows 10.5 (which I assume Pointing is using), the change scene behavior cuts off all other behaviors.
In that version, if you had a timer with a duration of 0.1 seconds, the sound would play for exactly one tenth of a second before being cut-off by the scene change.
It doesn't matter if the 'run to completion' box is checked or not. Again, I must stress that this is what I've observed on the Windows 10.5 version of Creator - I haven't tested previous versions, nor do I have a Mac, so I can't attest to how it might work differently in those environments.
However, I did find manage to figure out a work around:
The simple fix was to tie the play sound behavior to a static actor in the next scene. Doing so will give you same result as observed in the tutorial Pointing is probably referring to.
@jorkos that may work, but due to the way Scene Change affects other behaviors in windows creator, I suspect that he'd run into the same problem.
I hope that helps!
I tried creating an actor to make the sound, and also tried setting a delay to the 'change scene' action. Both times the sound is cut off as soon as the 'change scene' initiates. Even with the run to completion set.
In the tutorial that I was following it works perfectly on the windows version, but I don't know what version the instructor is using so that may be the trick.
I will publish it to the GS store later today and see if the issue continues to a published game and let everyone know.
Just waiting on my Pro upgrade to be applied as well, so I am here for a while and you are all stuck with me :-)
Greg
just use a rule then, when clicked change scene after length of sound....
That's what I am trying to do at the moment. GS for windows crashes every time I hit preview.....about to do an un-install and re-install. Only change since yesterday is the MS patch release from last night....sigh.