-
-
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
Metadata doesn't save when adding it in editor #66421
Comments
I can't reproduce this on current master. Is the metadata added to Script or to the Node? Metadata set on the script won't be saved. |
Yes, the metadata is added to the script. But that is the problem. I tried finding info about this but didn't couldn't find anything. But the metadata DOES let me add it on a script without a node, which was fixed by you in one of latest merges. Its good that it doesn't crash, however if this is not the correct way to use metadata and won't give you the actual results that you entered in the UI, why not add an error message to the screen saying you cant do that and stop you from doing it? I'd say there's a couple things that can be done, in order of easiest to hardest:
Obviously I don't expect all this to happen anytime soon, but I assume 1 and 2 should not be THAT hard to do and would stop most of the confusion. |
This has been a long existing issue. Script is a special type of resource that does not have other properties saved (which is what could be improved). You can reproduce this on 3.x too. Checking
The crash is not related to script properties not saved. It crashed because the dialog did not handle Resource correctly. Since your MRP uses |
Thanks for confirming this, I was suspecting Script is a special type of resource and that it doesn't save properties(not just meta). I'll be aware of this in the future.
This works if you the scripts inherits from node, but if the script is just RefCounted you still need to dynamically add meta in code, which kinda defeats the purpose for my use case of it being easy to add const values that are not hard-coded inside the script itself. Thanks for the reply! |
Shouldn't this issue be closed? |
Dunno. The original issue deviated to a UI focused problem. But is still a problem and just because it is the "intended" way it should work, doesn't mean it isn't an issue and can't be misleading. Especially since in the UI/console nothing says something is wrong. |
Closing as duplicate of #84653. That issue may be more recent than this one, it is better detailed than this one, as it is more circumspect. |
Godot version
4.0 dev, ef26618, compiled in debug mode
System information
Windows 10
Issue description
Script metadata is being added in the editor, but isn't actually updated behind the scenes.
When doing a check with has_meta(), the metadata is not found.
When closing and re-opening the project, the metadata is not found in the editor since it isn't actually saved.
Steps to reproduce
Make a project, add metadata to a script via the inspector, try accessing it in code.
Also close and re-open the project to confirm the metadata is not saved.
Minimal reproduction project
Metadata Deleted.zip
The text was updated successfully, but these errors were encountered: