Parser error: Unexpected "if" in class body

hello ı have toruble

Remove spaces at the beginning of the lines. And change export to @export

Thanks for your reply, I will try

That’s Godot 3.5 notation. In 4, it’s @export var <your variable name here>.

Please don’t take this the wrong way, but, have you followed any basic lessons on how to program in GDScript? Again, this is not meant to be an insult, but conditional logic and scoping are some of the first things any lesson plan would cover right after variable declarations.

1 Like