-
-
Notifications
You must be signed in to change notification settings - Fork 21.6k
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
Setting exported node properties from the inspector bypasses their setter #74050
Comments
It definitely works, but I had some issues getting it to run at first. Can you try saving / closing and opening the scene and see if that makes the script work? I just did this myself a few hours ago, and I noticed my GDScript code wasn't getting updated when I made changes. Closing and opening the scene seemed to make the setter work for me. |
Nope. I cannot get the setter of the node export to work. Addendum: on the editor I cannot get it to work, on runtime it works. |
Ah, I missed that there was both a Node and a NodePath. Only the NodePath export works. I can confirm the
it seems that somehow it uses |
Adding to this: the value of a |
This issue has the I'll also add that the above comment says the inspector will always show null, however I've found that the inspector always shows what you drag into the property, regardless of the actual property's value (i.e. drag a node in, set to null in code, still see node in inspector). |
@Tuckertcs The inspector will show the Node correctly. What @michaelhue was saying is that if you try to get the value from a |
The example given here: https://docs.godotengine.org/en/stable/classes/class_object.html#class-object-method-get-property-list works but when holding_hammer is of type Node, the setter logic actually never runs therefore making the use case impossible. |
Fixes to changes from godotengine#76114. This PR remove the hack with pointer and replace it with a proper handling from EditorPropertyNodePath of both NodePath and Node. Also needed to revise a bit the saving and loading of scene to handle properly the change. Fixes godotengine#74050. Fixes godotengine#74141. Fixes godotengine#75981. Fixes godotengine#76642. Revert "Fix typed array export... again" This reverts commit da8d673. Co-Authored-By: Tomek <[email protected]>
* various tweaks and changes * more independant swimming logic * signal connector fix using godot 4.1 dev 4 godotengine/godot#74050 * character mover tweaks * fix signal connector again * add a fixed camera area * various fixes * bug fix for global signal and collectableinventory item add
Godot version
v4.0.alpha11.official [afdae67] (when the feature was added) and newer (still happens in RC6)
System information
Windows 10
Issue description
I'm unable to handle when the user sets an exported node property (this feature: #62185) from a setter in the editor (tool script).
I don't know if this is intentional or not, but for me it was unexpected. I had to revert back to
NodePath
s.Steps to reproduce
@tool
at the top of the scriptThe setter is not bypassed when running the game, it is only bypassed in the editor.
We can compare with a
NodePath
property, which setter is not bypassed regardless if it is in the editor or in game runtime.Minimal reproduction project
nodepath.zip
The text was updated successfully, but these errors were encountered: