I am following a tutorial by Coco Code on how to make settings for a game. I always end up getting this same error message. I am very new to this, so any advice would be appreciated!
Here is my code
extends Control
@onready var main_buttons: VBoxContainer = $MainButtons @onready var options: Panel = $Options
Called when the node enters the scene tree for the first time.
func _ready() → void:
pass # Replace with function body.
Through the power of digging into discourse’s raw format I can tell you’ve indented func _ready too much, but it already exists anyways, so you should move your code to the ready function that works.
Thanks for the tip regarding my code representation.
Here is my updated code
extends Control
@onready var main_buttons: VBoxContainer = $MainButtons
@onready var options: Panel = $Options
# Called when the node enters the scene tree for the first time.
func _ready() -> void:
pass # Replace with function body.
func _process(delta: float) -> void:
pass
func _ready(): ->void
main_buttons.visible=true
options.visible=false