I'm trying to make a pause screen, but I don't know why it doesn't work.
Any ideas
extends Control
func ready():
$MarginContainer/CenterContainer/VBoxContainer/Texturebutton01.grabfocus()
func physicsprocess(delta):
if $MarginContainer/CenterContainer/VBoxContainer/TextureButton01.ishovered() == true:
$MarginContainer/CenterContainer/VBoxContainer/TextureButton01.grabfocus()
if $MarginContainer/CenterContainer/VBoxContainer/TextureButton02.ishovered() == true:
$MarginContainer/CenterContainer/VBoxContainer/TextureButton02.grab_focus()
func input(event):
if event.isactionpressed("uicancel"):
$MarginContainer/CenterContainer/VBoxContainer/Texturebutton01.grabfocus()
gettree().paused = not get_tree().pause
visible = not visible