New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Exported variables do not call _set method #56614
Comments
As far I tested, |
I have the same issue on macOS (M1) |
test.gd tool
class_name Test
extends Resource
export var number = 0
func _set(property, value):
print("changed")
match property:
"Number":
number = value
_:
return false
return true You match for If you want a setter to be called for a property with No idea why |
I read a tutorial, which did it like this, but I got the problem that it does not call the I do not know if this could get to work on some older version. |
Can confirm the issue. Currently trying to make the script generate a texture every time one of 4 different variables is assigned. Having to write setget for all fo them is a hassle :[ |
AFAIK |
Just ran into this and found a workaround, which is to add a / before your variable name:
_set is then called every time the variable is updated. |
It doesn't work in godot 4.0.2 as well |
This is just my speculation. After quick scan through the godot source code, here |
But what is then the reason for |
@thornySoap Normally also means that if you don't override the method it is going to fail because that property doesn't exist. Docs can probably be improved. |
@YuriSizov But on the other hand inherited class members (at least from built-in classes) do trigger |
If that's the case, then there is probably an issue with the multi-level call implementation for Object.set. Since each class in a hierarchy is considered in order, I guess it's possible that extending classes don't know about some parent members. I agree, this is a conflicting behavior, but I'd need to test it to see what's going on. |
Is this still a valid issue? |
Godot version
3.4.stable
System information
Windows 10
Issue description
When I export a script property with
export
keyword or the_get_property_list
method, this does not call_set
method. In the case of using_get_property_list
, if the property name does not match a script property, it calls the_set
method, but it cannot set this property.Steps to reproduce
I let a minimal project where there is a resource file with Number property.
changed
.Minimal reproduction project
Test.zip
The text was updated successfully, but these errors were encountered: