Godot Version
Replace this line with your Godot version
Question
Help, when I’m trying to launch my game the error comes up:
E 0:00:00:811 @implicit_ready: Trying to assign value of type ‘Panel’ to a variable of type ‘VBoxContainer’.
extends Node2D
@onready var main_buttons: VBoxContainer = $mainbuttons
@onready var options: VBoxContainer = $Options
# Called when the node enters the scene tree for the first time.
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta: float) -> void:
pass
func _ready() -> void:
pass # Replace with function body.
main_buttons.visible = true
options.visible = false
func _on_start_pressed() -> void:
get_tree().change_scene_to_file("res://scenes/world.tscn")
func _on_options_pressed() -> void:
print("Options pressed")
main_buttons.visible = false
func _on_quit_pressed() -> void:
get_tree().quit()