• 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!

GameMaker Open a Menu on button press

Y

yonseo

Guest
Goal: Open a Menu when pressing tab key
Problem: I created a script for the menu and launch that script in the player object.

Problem: When the player presses tab a message will appear and it works. What does not work is the commented code
Code:
room_goto();
I want to be able to change rooms to the menu room when the player presses tab. When I test this code it freezes player movement and no room change.

Code:
journal = keyboard_check(vk_tab)

if (journal == 1){
    show_message("You pressed the Tab key.");
    //room_goto(room_Menu);
    }
 
W

whale_cancer

Guest
Without seeing more, I would say put that script at the end of your script.

room_goto() is not instant and the rest of your code in the step will still execute. If it is at the end and it doesn't work we can rule out a lot.
 
Y

yonseo

Guest
Same problem. I put scr_Menu(); at the end of obj_Player, I also tried just using the script itself instead of calling it. Works fine with the message pop up but not with
room_goto(room_Menu);
 
Perhaps there is an issue with the room room_Menu itself.

What happens if you move the room_Menu to the top of the room list in the resource tree and run the game.

Does the menu load successfully or does it freeze the game. This might help narrow down the issue.
 
Y

yonseo

Guest
Moving room_Menu to the top of the list, run the game and a black screen appears. I do have a background image on the room_Menu but it does not appear.
It seems the room_Menu itself has a problem. I have deleted the room and created it again with the same background and same name but still a black screen at launch.
 
Ok, so you'll need to check all your room settings
- view / viewport settings
- camera settings
- room creation code (if any)
- what objects do you have in the room and what code do they run
 
Top