• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

Calling a step within a case

D

Darren

Guest
I'm trying to change the volume of my game within my settings but it doesn't seem to work for me, I'm not sure why because it works for changing the room.

This is my code.

switch (mpos)
{
case 0:
{
if global.musicPercentage = 100 then
{
global.musicPercentage = 0;
} else
if global.musicPercentage = 0 then
{
global.musicPercentage = 100;
}
break;
}
{
room_goto(rm_mainmenu);
break;
}
}
 
M

mikahon

Guest
Just changing the variable won't magically update the volume, you have to use audio_sound_gain on the music to update it with the proper value
 
D

Darren

Guest
I knew that, solved the issue now though, stupid mistake from spending too long looking at the screen I forgot to set my sound controller object to global so it wasn't changing anything.

Sorry for the lack of info guys, didn't want to type out too much in one block or I thought people wouldn't be bothered to read it all, figured people would ask for any extra info they needed but it's fixed now!

Also @obscene just realised you're creating Orphan, been waiting for that game for a while, looking forward to it!
 
Top