#Main menu doesn't work after i go to it from pause menu
1 messages · Page 1 of 1 (latest)
extends Control
func _process(_delta):
testEsc()
func resume():
get_tree().paused = false
hide()
Input.set_mouse_mode(Input.MOUSE_MODE_CAPTURED)
func pause():
get_tree().paused = true
show()
Input.set_mouse_mode(Input.MOUSE_MODE_VISIBLE)
func testEsc():
if Input.is_action_just_pressed("esc") and get_tree().paused == false:
pause()
elif Input.is_action_just_pressed("esc") and get_tree().paused == true:
resume()
func _on_resume_pressed():
resume()
func _on_go_to_menu_pressed():
get_tree().change_scene_to_file("res://Main menu.tscn")
am i doing something silly that's messing with it, i don't get it
When you call _on_go_to_menu_pressed(), try also adding get_tree().paused = false
If that doesn't resolve anything, I would ask that you share the scene tree and the main menu code as well
I feel it's also the same issue, try doing get_tree().paused = false since it's only switching scenes, and not unpausing
okay i tried doing that but pressing main menu on the pause just breaks it now
here's what i have
is my system just bad for what im trying to do
I don't think it is bad.
Do this for me:
in _ready() in your main_menu.gd, put this:
print("Paused: ", get_tree().paused)
in my... _ready?
thats only on my player.gd
or do you want me to add it to my main_gd
Sorry, also remove the get_tree().paused = false in your _on_go_to_menu_pressed() function
Or comment it out at least
okay i removed it, it works again but the main menu continues to be broken :(
Hrm, does it print anything to the console when main menu loads up now?
this is printed :O
Interesting.
In main_menu.gd, in your _ready() function, remove the print and just put get_tree().paused = false
Then whenever you load the scene, if it's paused for whatever reason it should unpause
Let's goooo
thank u very much o7