0 votes

extends Label

func ready():
if Input.is
self.visible = fasle

why isn't it vanishing?

Godot version latest version as of January 12th 2022
in Engine by (14 points)

also, attach simple scripts like these to the main node in your scene. It's a lot easier to handle.

1 Answer

+1 vote

the ready function runs only once, when the node enters the tree.
I'd suggest you use the _input() function like this:

func _input(event):
    if event.is_action_pressed("ui_enter"):
        self.visible = false
by (110 points)
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.