Having Trouble With "Standalone lambdas cannot be accessed. Consider assigning it to a variable."

Godot Version

Replace this line with your Godot version

Question

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.

func _process(delta: float) → void:
pass

func _ready(): ->void
main_buttons.visible=true
options.visible=false

func _on_button_pressed() → void:
pass # Replace with function body.

func _on_Start_pressed() → void:
get_tree().change_scene_to_file(“res://Fighting UI.tscn”)

func _on_Settings_2_pressed() → void:
pass # Replace with function body.
main_buttons.visible=false
options.visible=true

func _on_Exit_3_pressed() → void:
get_tree().quit()

You probably have indented a function too much, it’s impossible for us to tell though because your code paste is not formatted properly

Read through this too

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.

func _ready() -> void:
	main_buttons.visible=true
	options.visible=false

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

It works! Thank you so much, you have no idea how long it took to actually get some good advice!