SetGet setter function class not found

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

I’m trying to follow some tutorials, and during a section about set/get, I came across this error:

Parser Error: Setter function ‘set_score’ not found in class.

Here is my code:

extends Node2D

var score = 0 setget set_score

func set_score(value):
     score = value
     get_node("Score").set_text("Score "+str(score))

Thanks for any help.

is that only code you have, no other code?

volzhs | 2018-03-12 03:48

there is no other code

Nightraider | 2018-03-13 04:10