GameMaker Studio 2 – How To Transition Rooms Beginner Tutorial

44
7



Changing or transitioning between rooms is a necessary thing to do once your game starts growing. Here I will show you an easy and elegant way to do just that!

Social:
– Connect with me on Twitter @Aaron_LLTT:
– Become a valued Patron and receive more exclusive content @:
– Wanna hear from other developers in the industry? Head on over to my podcast, DevTalk, to listen to engaging conversations I have with various successful developers:

My Exclusive Courses💻🎮:
Bundle Course Package & More Here!

Starting Project Here —–
Finished Project Here —-

Nguồn: https://fivestarhotelsantalya.com/

Xem thêm bài viết khác: https://fivestarhotelsantalya.com/game/

44 COMMENTS

  1. i made 2 gates – one gate from level0 to level1, one gate from level0 to level2 but the level0 to level2 gate didnt work, it juz pause the game and the coding looks the same, only the destination n room target are different right? wut did i missed here?

  2. how about using the pos x and pox y of that warp but juz plus some distance like posX -= 50, posY = 0 as the warp position

  3. I can't get mine to work, can someone help me out?

    ERROR in

    action number 1

    of Collision Event with object obj_Player

    for object obj_ladder:

    Error in code at line 1:

    room_goto(targetRoom);

    ^

    at position 11: Unknown variable targetRoom

  4. This is much simpler and more elegant than the solution I came up with myself…. I never thought of putting the location into the Creation Code of the warp object instance… I was doing some convoluted branching 'if' shenanigans in my player instance Create event.

    However, I would suggest that, rather than hardcode the x & y locations your character will appear at, you could create a simple blank object (e.g. obj_Spawn), drop it at the point you want your character to spawn in the new room, change it's instance ID to something more friendly (e.g. to rmTwo_Spawn), then reference that instance in the Creation Code of your warp object instance as follows:

    targetRoom = rmTwo;
    targetX = rmTwo_Spawn.x;
    targetY = tmTwo_Spawn.y;

    That way if you move your spawn point to a different location you don't have to change the x & y co-ordinates manually in future.

  5. Thank you so much! This is so good video😳 I have a one question.
    I can change room this object.
    But this one is indicated under the map tips next room. How do this problem resolve?😢

  6. This was a really good tutorial, I followed it precisely but when i run my game the warp dose not warp me anywhere, what can I do?

  7. Thank you so much for your tutorials. Quick question though,
    my first warp works completely smooth and fine, but when she tries to go back, she cant walk up to the warp, it's like something is blocking her just a block or so away from the warp

  8. thank you very much but when i go into the warp and i go to the other room my screen gets pressed can you help me with this??

  9. But how do you make a transition in the menu like the splash screen of Undertale or the starting where it talks about the story itself? It has a slight transition where it moves to a black screen and then to the main menu for the splash screen and the next part of the story for the story part! I want to learn how to do that!! In other words, how do you make transitions without even moving a character? Like a timer that transitions you to the next scene! WITHOUT the character of course!

  10. hey man, does the colllisions works even if my player has the "if theres nothing x pixels ahead u can move"? beacause i have this problem where i do get the collision but the room doesnt change, and i can move the character and get it back, but when it gets back it gets stuck

  11. ı made my character persisdent when I get ın a room it works with no pronlem but when ı exit ı disappear

  12. Dont know why. But it have a Problem with Step Events from my Character.
    Wayne wich Code stands there.

    FATAL ERROR in

    action number 1

    of Step Event0

    for object obj_player_idle:

    Unable to find any instance for object index '100047' name '<undefined>'

    at gml_Object_obj_player_idle_Step_0 (line 1) – if input.magicatack

    ##############################################

    Someone any ideas ?

  13. Game is crashing everytime I play help me code error is Room_goto – and also by “TargetRoom” what am I doing wrong??

  14. I have literally copy and pasted the variable names from my create event to my player collision event and it still says in my create event that the variables are only being referenced once. Please help.

  15. hi when I write var targetRoom, targetX, targetY; in the war, this menssage happending variable target Y reference only reference once with a this signal (!) what i do?

  16. thank you, easy to understand, speedy, you are the best.
    gracias, fácil, rápido.
    eres el mejor, es lo que uno busca, tutoriales rápidos y fáciles de entender.

  17. as a beginner, i can tell your videos are very helpful! mayb i have an idea for a video perhaps when u run out of ideas lol, im trying to make a popup menu that displays other menus in it (like saving or items, etc.) but i have problems controlling their indexs when all of them are running, just a derp idea lol, peace

  18. oh my god i had no idea you could make the player character persistent… im so glad there was an easy way to do this, i was really racking my brain trying to figure out an easy way to go back to previous levels while being teleported next to the door

  19. Im getting the error:############################################################################################

    FATAL ERROR in

    action number 1

    of Step Eventobj_player

    for object obj_warp:

    Variable obj_warp.targetroom(100002, -2147483648) not set before reading it.

    at gml_Object_obj_warp_Collision_22d0ca0d_edbd_415d_ad95_066544ea5514 (line 1) – room_goto(targetroom);

    ############################################################################################

    ——————————————————————————————–

    stack frame is

    gml_Object_obj_warp_Collision_22d0ca0d_edbd_415d_ad95_066544ea5514 (line 1)

    when I go into the obj_warp help D:

  20. PLEASE HELP BEFORE I DIE FROM STRESS
    _________________________________________

    ############################################################################################

    FATAL ERROR in

    action number 1

    of Create Event

    for object OWarp:

    Variable OWarp.targetRoom(100009, -2147483648) not set before reading it.

    at gml_Object_OWarp_Create_0 (line 2) – room_goto (targetRoom);

    ############################################################################################

    ——————————————————————————————–

    stack frame is

    gml_Object_OWarp_Create_0 (line 2)

  21. Ok i fixed it somehow but now i have a new problem. When i teleport my player he just falls through the ground 😀

  22. Nice tutorial but my character disappears after he walked into the warp. The screen does switch to another room. And how do I make the warp object invisable?

  23. i know this video is a little bit old but, i have a problem when i put my player in persistent mode, i cant use restart_room(); how i can fix that ? i'm making a platform game so i need the restart room for when the player falls in the void he can go back in the start of the room

  24. I am in game maker studio 2 and when I transition to a room then come back to my original room the non persistanct objects do not load. How do I make the non persistanct objects load again so my room looks the same when I go back into it????

LEAVE A REPLY

Please enter your comment!
Please enter your name here