Godot Version
4.x
Question
There is a class for Character
class_name Character
extends Resource
//....more..
@export var hp:float
@export var hp_max:float
@export var atk:float
@export var def:float
after that , I made a new subclass
class_name PlayerDM
extends Character
@export var hp_max: float = 100.0:
get:
return hp_max
set(value):
hp_max = value
UI_EVENT.hp_info_changed.emit(hp, hp_max)
@export var hp: float = 100.0 :
get:
return hp
set(value):
hp = value
UI_EVENT.hp_info_changed.emit(hp, hp_max)
I know there are some error in this code, redefine I mean.
But what Can I do for override the subclass’s set and get ?