I do not understand this error (10, 1): The setter function isn't defined

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

signal score_updated
signal player_died

var score: = 0 setget set_score
var deaths: = 0 setget set_deaths

func set_score(value: int) -> void:
	score = value

func player_deaths(value: int) -> void:
	deaths = value

Note: edited for code formatting. In future please use the “Code Sample” button to format your code properly.

kidscancode | 2020-02-24 15:15

:bust_in_silhouette: Reply From: kidscancode

var deaths: = 0 setget set_deaths

You haven’t defined set_deaths(). You made a function called player_deaths().