R
Rocore
Guest
Hello,
I'm having a lot of problems trying to make change the background music from one room to another.
I wanted to put a track as an intro at the starting screen (Room0) and then change it when the user clicks the start button and enters to Room1.
Tried everything but not working,the starting intro music at Room0 will never stop.
Tried different ways, if - else if... then even if - else, but nothing works.
Both tracks are in the same music group.
In the object, at create sheet I have this:
And at the Async save/load I have this:
Not working.
Even with this, it will not work:
I have even tried directly to do this:
But it won't start at Room1 anyways.
Any idea?
Thank you a lot in advance
I'm having a lot of problems trying to make change the background music from one room to another.
I wanted to put a track as an intro at the starting screen (Room0) and then change it when the user clicks the start button and enters to Room1.
Tried everything but not working,the starting intro music at Room0 will never stop.
Tried different ways, if - else if... then even if - else, but nothing works.
Both tracks are in the same music group.
In the object, at create sheet I have this:
GML:
if (!audio_group_is_loaded(background_music)){
audio_group_load(background_music);
}
GML:
if (room == Room0){
audio_play_sound(intro_music, 0, true);
}
if (room == Room1){
if audio_is_playing(intro_music){
audio_stop_sound(intro_music);
}
audio_play_sound(playing_music, 0, true);
}
Even with this, it will not work:
GML:
if (room == Room0){
audio_play_sound(intro_music, 0, true);
}else if (room == Room1){
if audio_is_playing(intro_music){
audio_stop_sound(intro_music);
}
audio_play_sound(playing_music, 0, true);
}
GML:
if (room == Room1){
audio_play_sound(playing_music, 0, true);
}
Any idea?
Thank you a lot in advance