Music volume change takes affect only after 2nd time playing through game

Hi, I'm having some issues with my background music volume.

I have it set to play after .8 seconds of game start and because it's too loud, I've used "Change Attribute" to lower the volume to .3.

But the issue is, when I start up the game for the first time it plays at full volume. And after game is over and I play for the second time, I notice that the lower volume takes affect.

I've posted a screenshot of code, am I doing this in a wrong order? or is there a better way to keep the volume at .3 from the beginning in another way?

Thanks in advance for your help.

Comments

  • SocksSocks London, UK.Member Posts: 12,822

    Rather than having the attribute set to 1 and then changing it to 0.3 with a change attribute action, I would simply set the attribute at 0.3 to begin with.

    i.e. if you wanted an actor to be red, why would you have it coloured blue, then change it to red, why not just make it red to start with ?

    Hope that makes sense !

  • msx88msx88 Member, PRO Posts: 27
    edited July 2016

    Hi! thank you for your help Socks!

    To set the attribute at 0.3 to begin with, would i be modifying the Music Volume attribute underneath the Devices tab (highlighted in my screenshot) or do I create a new attribute within the Attributes tab?

    Thanks :)

  • SocksSocks London, UK.Member Posts: 12,822

    @jimmyxpark said:
    To set the attribute at 0.3 to begin with, would i be modifying the Music Volume attribute underneath the Devices tab . . .

    Yep!

  • msx88msx88 Member, PRO Posts: 27

    I really feel that there is a bug in the GS Creator in regards to volume change.
    I've tried the method of directly changing the Music Volume from 1 to 0.2 but it's not making any difference.

    Also, in the sample project file I've attached I'm using Change Attribute inside of an actor, you will notice the music will play at full volume the very first time around when you Preview and then once you refresh, it will play at a lower volume. If you fully restart GS creator(literally close it out then restart) and preview the file again, same thing will happen.

    Same thing happens when I export out the actual app in iOS and test it in device.

    I thought maybe it's a problem with my Mac so I tried this out on another laptop (Macbook Pro) and the same thing happened. I've even recreated the test file on the other machine just in case and it was the same.

    I've attached the test file if anyone wants to try it out. Again, thank you for your help in advance and I'm glad we have such a great community here we can give each other feedback on.

  • msx88msx88 Member, PRO Posts: 27

    If this issue is only contained within the GS creator it's fine but the problem is it carries over to the actual application that is exported out on iOS.

  • SocksSocks London, UK.Member Posts: 12,822
    edited July 2016

    @jimmyxpark said:
    I really feel that there is a bug in the GS Creator in regards to volume change.
    I've tried the method of directly changing the Music Volume from 1 to 0.2 but it's not making any difference.

    It works fine for me with your supplied project.

    @jimmyxpark said:
    Also, in the sample project file I've attached I'm using Change Attribute inside of an actor, you will notice the music will play at full volume the very first time around when you Preview and then once you refresh, it will play at a lower volume. If you fully restart GS creator(literally close it out then restart) and preview the file again, same thing will happen.

    As above, using the Change Attribute to set the music to 0.2 works fine for me, no problems at all.

    @jimmyxpark said:
    I thought maybe it's a problem with my Mac so I tried this out on another laptop (Macbook Pro) and the same thing happened. I've even recreated the test file on the other machine just in case and it was the same.

    Very odd, like I say I experience none of these issues with your test file, and the method (simply changing the volume to 0.2 with a change attribute behaviour) is one I use all the time and have never experienced this issue.

  • SocksSocks London, UK.Member Posts: 12,822
    edited July 2016

    One way you could solve the issue would be to simply lower the volume of your music track (by 13dB or so) and then reimport it, then you can have it at full volume (=1) in GameSalad and it will be playing at the volume you want (~0.2).

    Of course this doesn't solve the underlying issue - as it should be working as you have it set up - but as a workaround it works just fine.

    Example attached:

  • msx88msx88 Member, PRO Posts: 27

    Thank you Socks, you are helpful as always and I appreciate that very much.
    I think I may have to use the work around as you've mentioned above.

Sign In or Register to comment.