How ı can fix my pause menu (pause,start)

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By ThewExtreme

hello guys I have a probelm on my pause menu. I’m beginner on english and making game. so acually Im trying different something, my pause menu working like this (I wanna work like this):

extends Node2D 
var abd = 0 

func _process(delta):
if Input.is_action_just_pressed("Pause") : 
			abd = 1
			if abd == 1:
				$Control.visible = true
				get_tree().paused = true
				abd -= 0
			elif abd == 0:
				get_tree().paused = false
				abd -= 1

elif part is not important for now I was think there but I forget. İf you want u can tell me

and this code aim:
visible = true (this my pause menu)
get_tree().pause (and this is will stop game)
ım using “var” cause this code part is Global.
and I wanna work resume button.
my resume button codies like that:

extends Button



func _process(delta):
	if PalyerGlobal.abd == 1:
		get_tree().paused = false
	pass # Replace with function body.
	


	
	


func _on_Button_pressed():
	$"../../../..".visible = false
	PalyerGlobal.abd = 0
	pass # Replace with function body.

if you didnt understand me my Discord GM#8081 u can find me from there and we can talk on discord I can show u my screen (godot :))
thank for your help and care have nice day !!

:bust_in_silhouette: Reply From: Gluon

My guess is you havent set the pause mode on your pause menu. If you look in the editor you will see there is a “pause” function and it is probably set to inherit. You need to change this to “process” on your pause menu items. Then they should continue to process even after you pause the program.

I had done but this wasn’t work

ThewExtreme | 2022-11-20 18:21

Okay try changing the code in your pause menu to this

func _process(delta):
    if Input.is_action_just_pressed("Pause") : 
        get_tree().paused = false

Gluon | 2022-11-20 18:31