No second room transition (Solved)

Hi, i faced a weird problem. When i go from the menu to the first level of my game, the transition works but afterwards i cant get to the second level because of an error.
if i change the order (first level instead of menu screen) i can reach the second level.
basically i am just able to change the room once...

heres my transition code:

create:
/// @description Size Variables and mode setup
w = display_get_gui_width();
h = display_get_gui_height();
h_half = h*0.5;
enum TRANS_MODE{

OFF,
NEXT,
GOTO,
RESTART,
INTRO
}
mode = TRANS_MODE.INTRO;
percent = 1;
target = room;

step:

/// @description Progress the transition#
if(mode != TRANS_MODE.OFF){
if(mode == TRANS_MODE.INTRO){
percent = max(0,percent - max((percent/10),0.005));
}else{
percent = min(1.2,percent + max(((1.2 - percent)/10),0.005));
}
}
if(percent == 1.2) || (percent == 0){
switch(mode){
case TRANS_MODE.INTRO:
{
mode = TRANS_MODE.OFF;
break;
}
case TRANS_MODE.NEXT:
{
mode = TRANS_MODE.INTRO;
room_goto_next();
break;
}
case TRANS_MODE.GOTO:
{
room_goto(target);
break;
}
case TRANS_MODE.RESTART:
{
game_restart();
break;
}
}
}

and here my slide transition script:

///@Description Slidetransition(mode, targetroom)
///@arg Mode sets transition mode between next , restart and goto.
///@arg Target sets target room when using the goto mode
with(obj_transition){
mode = argument[0];
if(argument_count > 1) target = argument[1];

}
Edit: here is the error message:
___________________________________________
############################################################################################
FATAL ERROR in
action number 1
of Step Event0
for object obj_transition:
Moving to next room after the last room.
at gml_Object_obj_transition_Step_0 (line 21) - room_goto_next();
############################################################################################
--------------------------------------------------------------------------------------------
stack frame is
gml_Object_obj_transition_Step_0 (line 21)


Thanks for the help i am searching for this the whole evening...

Edit: got it fixed. after i changed the transition object to not persistent it worked again...
 
Last edited:
Top