godot: Properties Added With _get_property_list() Are Not Being Set
Godot version
v4.0.beta4.official [e6751549c]
System information
Windows 10
Issue description
I’m trying to learn how to make custom addons, and I’m having some issues getting custom properties to work. I prefer using _get_property_list() since it allows me to assign properties to groups, but for some reason the properties wont change in the inspector. I’m aware of the _get(property) and _set(property, value) functions, but they seemed ineffective when I tried using them, but I could be misunderstanding their functionality.
Overall _get_property_list() seems kind of hackey to use right now, especially since I have to use get(property) to access them in code… so it would be really nice if I could add @export vars to groups instead as making and referencing those are way easier.
Steps to reproduce
Install the custom plugin, enable it and place its custom node SceneProperties into a 3D scene. The script containing _get_property_list() is scene_properties.gd.
Minimal reproduction project
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 15 (7 by maintainers)
@Kalcen You can also have normal, unexposed (no
@export) properties and then expose them with_get_property_list. Then you don’t need_getand_set, as the variable itself will be used. You can still define your own setter and getter using the new property syntax (orsetgetin 3.x).So actually, since KoBeWi used the same name, this also works:
No, there is not. Please don’t use GitHub for support questions. Refer to our community platforms instead.
@YuriSizov It does use @tool — but reloading the scene worked. Thank you!
(I think reloading the scene should not be required, but maybe that’s being worked on.)
Closing. Not sure what you tried, but your script is missing
_get()and_set(), which are responsible for reading and writing the properties._get_property_list()only defines the properties, but doesn’t handle them.