YoYo Games Wiki

room_goto_next()

From YoYoGames Wiki

Description

This function moves the player to the next room.

Explanation

This will moves the player to the next room in the room list. The room list is circled in the picture below.

When no next room exists, an error is reported. So you should always first check whether the next room exists, as follows:

 if (room != room_last)
 {
   room_goto_next();
 }

Remarks

When calling this function, please realize that this change does actually not occur at that precise moment. It only happens after the current action is fully executed. So the rest of the script will still be executed, and the same applies to possible calling scripts.

See Also

Template:GMKB