How to Make a Pause Game Menu & Pause the Game ~ Godot 4 Tutorial

  Рет қаралды 34,042

Chris' Tutorials

Chris' Tutorials

Күн бұрын

Пікірлер: 54
@Game_DEV_4
@Game_DEV_4 Жыл бұрын
This is the best tutorial I found for menus in Godot, but if you want to make the menu open new tabs like for settings, I can't figure out how to do it. Thanks for the tutorials!
@taylorberukoff3242
@taylorberukoff3242 Жыл бұрын
Fantastic explanations and attention to detail. Very much appreciated!
@duccloud4101989
@duccloud4101989 10 ай бұрын
You saved my day. Thank you :D
@dzmitrypadrig4037
@dzmitrypadrig4037 Жыл бұрын
Very well explained! Thank you for these series!
@jordanfox840
@jordanfox840 Жыл бұрын
This is a little off-topic, but it seems to me like your node structure is a little different than what I usually see in Godot tutorials. You have the "game" node which has the levels as instances, rather than having the levels be the root node themselves. Does that mean that then when you go to change a level, instead of doing get_tree().change_scene_to_file("next_level") you instead have the root "game" node instance the next level in itself? It just seems to me that this decision should be made very early on in development, since essentially you are always going to be on the single game node instead of bouncing around a bunch of scenes. Is this what the Godot devs recommend? Or, can you tell me why you think this is optimal? Thanks.
@dreamhive3d
@dreamhive3d Жыл бұрын
I can't speak for the creator here, but I also use this structure. It allows for certain variables and signals to be more accessible, and makes it easier to switch out levels without having to pass a ton of information between them each time.
@Mop82-h4b
@Mop82-h4b Жыл бұрын
It does depend on the game youre making but generally and in my opinion its optimal, because it allows you to pass player data between scenes without autoloads/singletons (which I try to avoid using for bugfixing purposes).
@zero102321
@zero102321 Жыл бұрын
So how can you solve this problem? I've the same question too.
@lukarizzi1654
@lukarizzi1654 Жыл бұрын
@@zero102321 what problem? I'd also say that most of the time having a root game manager node is the optimal way to structure most projects. Otherwise in most cases you'd have to abuse a lot of autoloads to get some basic functionality for the project, I think.
@FloatingOer
@FloatingOer Жыл бұрын
I use this structure as well, the game I'm currently working on have a very interactive main menu and this structure allows me to just pause and hide the menu until a level is finished, this way all the interactions made remain exactly the same when the player returns without the need of saving and loading or transferring variables.
@glennsimpson115
@glennsimpson115 2 ай бұрын
Ok I have completely remade your whole tutorial video and recreated this 8 times now and it is not working. I click “esc” nothing happens. I asked on reddit /Godot 23 hours ago and no comments. I have spent 2 full days just on this one trying to get your pause menu to work. I just what to know why I am hitting a stage on this. I like the way you do all of this. And I see that no one else is having this issue.
@thepolyglotprogrammer
@thepolyglotprogrammer Жыл бұрын
Awesome tutorial! Thanks for sharing!
@BasementStudi0s
@BasementStudi0s 6 ай бұрын
mine pauses but doesnt resume EDIT: nvrm i just had to set the "game" node process to always
@frenchiestfry7306
@frenchiestfry7306 Жыл бұрын
Regarding my previous question, the only way i found to make a pause menu for more than 1 scene, is for every single scene to have its own game manager. How can i do this in a better less time consuming way?
@efhunter
@efhunter Жыл бұрын
Did you ever find a solution for this?
@frenchiestfry7306
@frenchiestfry7306 Жыл бұрын
@@efhunter unfortunetly no, i only found some pause menu templates that i havent got around to use yet
@arcanealchemist3190
@arcanealchemist3190 Жыл бұрын
@@frenchiestfry7306 all you should have to do is place all of your scenes as a parent of the game manager. i feel like you dont understand what the purpose of the manager is at all. are you just copy and pasting code?
@ThisTimeIsForMe
@ThisTimeIsForMe Жыл бұрын
@@arcanealchemist3190 Speaking from personal experience, I am trying to learn code from tutorials because my mind has difficulty absorbing information via text only. I don't understand the purpose of the manager yet, and their comment is one I might ask to try to understand how it works. We come here to learn so I think it's safe to assume most people watching these videos don't yet understand fully how everything works and we are trying to learn by doing.
@arcanealchemist3190
@arcanealchemist3190 Жыл бұрын
around 16:18 when i got to assign the game manager node to my pause menu, all the nodes are greyed out. so i cant select my game manager node and hit the okay button. any ideas why this is?
@stygianrot5361
@stygianrot5361 Жыл бұрын
at about 15:10 you set a class name for the game manager (in the tutorial it being GameManager), and in the pause_menu script you write @export var game_manager : GameManager, (the GameManager being the class name of the game manager). If the @export var "type" you write in is different from the class name, godot won't let you drag it in, since the node isn't that class! Make sure that the class name you feed in for the export variable is the same as the game manager's class name, or alternatively you don't have to write in anything besides "@export var game_manager", and you should be able to drag in any node (preferrably the game manager node haha), hope this helps :)
@arcanealchemist3190
@arcanealchemist3190 Жыл бұрын
@@stygianrot5361 thanks! this did end up being the issue, somewhere in all the renaming my files got completely messed up. ended up just kinda, re-doing the whole tutorial since renaming stuff more just created more errors. --im now having other issues with the project but i think im calling it quits for now. so frustrated-- i figured out my other issues, rushing through the tutorial i made a series of silly little mistakes, like not setting the process on the gamemanager node to always. so when i paused, the script which was necessary to unpause the game was no longer running.
@stygianrot5361
@stygianrot5361 Жыл бұрын
@@arcanealchemist3190 no problem! and yeah, it's way too easy to make little mistakes like that, i'm glad you were able to figure them out :D
@Higgsinophysics
@Higgsinophysics 2 ай бұрын
What about the warning?
@bazookabasssound
@bazookabasssound Жыл бұрын
how do i change my mouse visibility when pausing the game/opening the menu?
@cookiekoneko
@cookiekoneko Жыл бұрын
I was able to do it by putting this line of code in the input function in the game manager script - Input.set_mouse_mode(Input.MOUSE_MODE_VISIBLE)
@cookiekoneko
@cookiekoneko Жыл бұрын
you will need to turn it back somewhere the code for that would be - Input.set_mouse_mode(Input.MOUSE_MODE_CAPTURED)
@izzy67893
@izzy67893 Жыл бұрын
pls help it just keeps syaing nuull instance when im trying to show or hide
@MoviesManiac-u7r
@MoviesManiac-u7r 5 ай бұрын
it can be what ever scene you trying to load is node included in your main game node my game had that same issue cause my pipes for super human flap game were not in the main scene node of animation i donot know your game but this might help
@izzy67893
@izzy67893 5 ай бұрын
@@MoviesManiac-u7r Its been a few months but thank you alot for the info!
@IliaElizarov
@IliaElizarov Жыл бұрын
Thank you :)
@CorrodedMoon
@CorrodedMoon 20 күн бұрын
The toggle game paused signal isnt recognised for me
@ruru9731
@ruru9731 Жыл бұрын
What editor theme are you using for Godot?
@herc34es
@herc34es Жыл бұрын
Excellent tutorial. I think I followed every step correctly, but the ESC button does not cancel the menu screen for me. Will watch it again just in case I missed something
@Leghar
@Leghar Жыл бұрын
I fixed this by removing the Input code in the GameManager. (I’m using a global autoload). And it works now. I think the duplicate Input codes were fighting the close the menu but were okay with opening the menu.
@sarahpuspdew
@sarahpuspdew Жыл бұрын
@@Leghar which input code do you mean? coz im using global autoload also and having this issue
@Leghar
@Leghar Жыл бұрын
@@sarahpuspdew at 15:15 lines 15-17. I took those out and used code within the pause menu for pausing and unpausing. Its been a while since I've messed with this but I hope this helps. func _input(event: InputEvent) -> void: if event.is_action_pressed("menu") and global.playerHP > 0: show() global.game_paused = true $Panel/VBoxContainer/ResumeButton.grab_focus() func _on_resume_button_pressed() -> void: hide() global.game_paused = false
@a.aspden
@a.aspden Жыл бұрын
Is it possible to pause a simulation and continue using UI buttons instead of a keystoke? I want to be able to control the simulation with clickable buttons.
@ray_is_here
@ray_is_here Жыл бұрын
Yeah. Just add texture rect in canvaslayer (texture rect should be child of canvaslayer not of control) then import your button image into it.Then In texture rect you can see action. In action add the same input as you do with escape e.g. ui_cancel. And it will work as escape key
@copeless1090
@copeless1090 Жыл бұрын
@@ray_is_here why shouldn't it be a child of control?
@ray_is_here
@ray_is_here Жыл бұрын
@@copeless1090 Because it will work with canvaslayer
@infinite2692
@infinite2692 Жыл бұрын
How can i add music??
@frenchiestfry7306
@frenchiestfry7306 Жыл бұрын
How can i have this pause menu without making a 'GameManager' node and repeating this process for every scene in the game? There has to be a way to display this in all scenes witout having to redo this for all of them
@capuchinosofia4771
@capuchinosofia4771 Жыл бұрын
I know its seven months later, but did you try making it a autoload/singleton? That way you wont need to make everything in the gamemanager.
@jxstise2296
@jxstise2296 Жыл бұрын
The pause works for me but for the first pause, I need to press the pause key twice then after it works whenever. Does anyone have a suggestion?
@coolguy230
@coolguy230 Жыл бұрын
idk i have the same problem did you fix it
@AlChestBreach
@AlChestBreach Жыл бұрын
I think I was having this problem, my menu was on screen when gameplay was running. In the 'game_manager' script I took away the ! punctuation mark and it flipped/fixed it to get_tree().paused = game_paused get_tree().paused = !game_paused TO get_tree().paused = game_paused
@coolguy230
@coolguy230 Жыл бұрын
@AlChestBreach thanks but I just used different code and it works with get_tree().paused = !game_paused
@damnthishandleistaken
@damnthishandleistaken Жыл бұрын
Are you planning on getting the Save and Load buttons to work?
@TheMaJestic14
@TheMaJestic14 Жыл бұрын
Thank you for the dope tutorials Chris , was wondering if you could do one on audio servers ? and can you give me a shoutout ;D
@SGTIvan921
@SGTIvan921 11 ай бұрын
5:52
@ruobian
@ruobian Жыл бұрын
i hate the tutorials those have a title how to do only one thing, but explain billion things.
Super Easy Pause Menu In Godot 4
16:50
rayuse rp
Рет қаралды 9 М.
Война Семей - ВСЕ СЕРИИ, 1 сезон (серии 1-20)
7:40:31
Семейные Сериалы
Рет қаралды 1,6 МЛН
Godot Scripts I add to Every Game
12:34
Aarimous
Рет қаралды 75 М.
I built a DeepSeek R1 powered VS Code extension…
7:02
Beyond Fireship
Рет қаралды 317 М.
How Do Game Devs NOT Overscope??
9:04
Green Light Dev
Рет қаралды 18 М.
I Made the Same Game in 8 Engines
12:34
Emeral
Рет қаралды 4,4 МЛН
Tutorial: Pause Menu in Godot 4
18:09
Bramwell
Рет қаралды 23 М.
How to Create a INVENTORY in Godot 4 (step by step)
25:31
DevWorm
Рет қаралды 90 М.
Let's Program Doom - Part 1
25:13
3DSage
Рет қаралды 470 М.
Giving Personality to Procedural Animations using Math
15:30
t3ssel8r
Рет қаралды 2,7 МЛН
How To PLAN your Game as a Solo Developer
16:26
Heartbeast
Рет қаралды 539 М.
How to Make a Roguelike Card Game on Godot
2:10:19
DeveloperEzra
Рет қаралды 98 М.