context: im making a main menu and my quit button has this error and ive been trying random stuff heres the code the problem is bolded class_name MainMenu
extends Control
@onready var start_button: Button = $MarginContainer/HBoxContainer/VBoxContainer/start_Button as Button
@onready var quit_button: Button = $MarginContainer/HBoxContainer/VBoxContainer/quit_Button2 as Button
@onready var start_level = preload(“res://pause_menu.tscn”) as PackedScene
func _ready():
start_button.button_down.connect(on_start_pressed)
quit_button.button_down.connect(on_quit_pressed)
func on_start_pressed() → void:
get_tree().change_scene_to_packed(start_level)
func on_quit_pressed() → void:
get_tree().quit()