Error: Standalone lambdas cannot be accessed.(idk why its happening.)

:bust_in_silhouette: Reply From: Cyber-Kun

can you please provide a snippet of the code. it’s really hard to know what’s going on if we don’t know what the code is. lambdas are standalone functions inside of other functions.

func _ready():
    var lambda = func(): print("this is a lambda")
or you could use it like this:
func _ready():
    $MenuButton.pressed.connect(func(id_pressed): print(id_pressed))

I didn’t test the above code in godot but I have used lambdas in connect() before. this code might not directly work but with a few tweaks it should. the only thing I can think might need to change is the pressed signal for the MenuButton think it should be id_pressed