What does this error mean?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Idleman

I am trying to put a setter, but don’t know why keep getting this error. It is a standard line of code, can not figure out what is the problem. Did I do anything wrong? Thank you.

expected end of statement after expression, get setget instead

var count = 12 setget setter

I believe it’s missing a comma at the end to indicate that you want a setter but not a getter:

var count = 12 setget setter,

timothybrentwood | 2021-07-26 14:29

:bust_in_silhouette: Reply From: klaas

Hi,
this line of code is perfectly fine. Are you sure this is the line of the error?

Thanks for answering my question. It is weird, somehow it keep telling me the error, but I have no problem with setget on other parts of my project. Anyway, I end up using another approach to achieve the intent result without using setget.

Idleman | 2021-07-26 13:04

:bust_in_silhouette: Reply From: uniquegamesofficial

You code is not file. You should write:

var count = 12 setget setter

func setter(value: int) -> void:
count = value

You have to write a function for the setter