Godot Version
4.3
Question
I’m currently working on a pause menu for my game. I made a pause menu UI and then wrote codes in it:
extends Control
func pause() -> void:
get_tree().paused = true
show()
func resume() -> void:
get_tree().paused = false
hide()
func _ready() -> void:
hide()
func _process(delta: float) -> void:
if Input.is_action_just_pressed("ui_cancel") && !get_tree().paused:
pause()
elif Input.is_action_just_pressed("ui_cancel") && get_tree().paused:
resume()
func _on_resume_pressed() -> void:
resume()
func _on_restart_pressed() -> void:
get_tree().reload_current_scene()
func _on_exit_pressed() -> void:
get_tree().quit()
After that I tried it and it worked except menu buttons. They are not even poping up when my mouse enters the area of buttons. I am really trying to make a pause menu for 2 days just because of this problem. Thanks for anyone will help.
(the pause menu UI is set to always process)