0 votes

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.grab
focus()

func physicsprocess(delta):
if $MarginContainer/CenterContainer/VBoxContainer/TextureButton01.is
hovered() == true:
$MarginContainer/CenterContainer/VBoxContainer/TextureButton01.grabfocus()
if $MarginContainer/CenterContainer/VBoxContainer/TextureButton02.is
hovered() == true:
$MarginContainer/CenterContainer/VBoxContainer/TextureButton02.grab_focus()

func input(event):
if event.is
actionpressed("uicancel"):
$MarginContainer/CenterContainer/VBoxContainer/Texturebutton01.grabfocus()
get
tree().paused = not get_tree().pause
visible = not visible

in Engine by (25 points)

1 Answer

0 votes

In which line 'grab_focus' is not working?
Anyway, I noticed that there is a 'Texturebutton01' (with a 'b') and a 'TextureButton01' (with a 'B').
That's probably what is wrong.

by (250 points)

Ho my god¡¡

This is embarrassing .... thank you very much. I am new to Godot .... I have much to learn yet.
Thanks again.

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to [email protected] with your username.