0 votes

Code:

extends Button

func _ready():
    pass

func _process(delta):
    if Input.is_key_pressed(KEY_ESCAPE):
        get_tree().quit()


func _on_New_Game_pressed():
    print("Pressed")
    get_parent().get_node("AnimationPlayer").play("Fade")
    get_tree().change_scene("res://Scenes/Level1.tscn")
in Engine by (32 points)

Is the pressed signal connected properly?

What do you mean?

it worked before but now it doesn't

Presumably, you have a button in the scene that should run the code found in the _on_New_Game_pressed() function, right? To make that happen, you need to connect that button's pressed signal to the _on_New_Game_pressed() function. I assume you know how to do that from within the Node | Signals inspector panel?

I clicked on node I think it was and there were a list of functions and I clicked the one I needed and it added it

1 Answer

0 votes
Best answer

Found the problem, My color rect was covering my button.

by (32 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 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 webmaster@godotengine.org with your username.