Open drusin opened 3 days ago
This is pretty covered by the note on the documentation:
Note that a property must be present in
get_property_list
, otherwise this method will not be called.
I'm not sure what is missing from this description
See also:
Note that a property must be present in
get_property_list
, otherwise this method will not be called.I'm not sure what is missing from this description
Script variables are present in get_property_list()
, but _set()
and _get()
are not called for them. Probably _get_property_list()
was meant, although that doesn't matter either, as long as the real variable exists.
You can use GDScript setters/getters for real variables. If you want to reuse the same setter/getter for multiple variables, there are separate proposals, like https://github.com/godotengine/godot-proposals/issues/6750.
Tested versions
-Reproducible in Godot v4.3.stable, v4.2.stable, 4.0.3.stable, 4.0.stable
System information
Godot v4.3.stable - Windows 10.0.22631 - GLES3 (Compatibility) - NVIDIA GeForce GTX 1080 Ti (NVIDIA; 31.0.15.3713) - 12th Gen Intel(R) Core(TM) i5-12400F (12 Threads)
Issue description
When reading or writing real members defined in the class,
_get
and_set
are ignored, they are only called for custom properties that are returned via_get_property_list
. The documentation and meaningful special values likenull
suggest that this is not desired behavior.Steps to reproduce
Minimal reproduction project (MRP)
get-bug_repro.zip