Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | Ellye |
I have multiple attributes that I want to perform exactly the same procedure on their setters.
For example, I have:
var foo : float setget _set_foo
var bar : float setget _set_bar
func _set_foo(value : float) -> void:
foo = _some_function(value)
func _set_bar(value : float) -> void:
bar = _some_function(value)
Let’s say I have N different variables, and they all would have this exact same setter.
Is there a way to make it a generic setter instead, so that I can write it only once and use it for all variables?