Godot Version
4
Question
I'm making a simple game but my code isn't working. The principle is quite simple, i want it to exit the game when i type apple and press the button. How can i do this? Here's my code:
@export var input_field: TextEdit
func _ready():
connect("pressed", Callable(self, "_on_button_pressed"))
func _on_button_pressed():
var user_input = input_field.text
if user_input == "apple":
get_tree().quit()