The documentation says that when the change to the variable is made by an external source the setter function will be called and that this happens before the value is changed.
But it doesn't seem that way with arrays and dictionaries.
The only way I get the setter to work as intended is when I duplicate the entire array/dict make the changes and then set the value to the original variable:
#fruits = ["Pineapple","Pear,"Grapes"]
#This calls the setter function properly
var fruits_dup = $Child.fruits.duplicate()
fruits_dup = "Orange"
$Child.fruits = fruits_dup
#This will set the value and then call the setter
$Child.fruits = "Orange"
#Array/Dict Methods will bypass the setter completely but getter is called
My goal was to check if the array had changed and update my inventory only in the slots that have changed instead of having to emit a signal every time the values are changed.
There's a changed() signal for resources but I've read that it's bugged and it doesn't work at all anyone knows something about this?