Replies: 3 comments
-
This would be really cool, I've just wasted a few hours trying to find out why godot would randomly load the wrong scene until I found out that they had the same UID. A small warning would've helped a lot, manually resetting the UIDs was super simple in the end. |
Beta Was this translation helpful? Give feedback.
0 replies
-
Made a PR for this godotengine/godot#92972 |
Beta Was this translation helpful? Give feedback.
0 replies
-
Implemented by godotengine/godot#92972. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Background:
Godot correctly creates new UIDs for resources duplicated via its FileSystem dock, which was implemented via pull request 66706 in response to issue 54774.
The Issue:
Although PR 66706 was implemented in 2022 and has been included in all versions of Godot 4, users continue to have issues with duplicate UIDs as can be seen by half a dozen comments towards the bottom of 54774.
In my case (and I suspect in the case of most, if not all, users who continue to experience this issue), the culprit was having duplicated the files outside of Godot. Many of us use many tools in our development activities and it's normal to use OS-provided mechanisms to duplicate files, such as Windows' File Explorer, macOS' Finder, various command shells, or external editors depending on whichever feels the quickest at the moment.
Note that the same issue (duplicated UIDs) can also arise if a previously renamed resource file is resurrected from version control, though this might be a rarer case.
My proposal:
Whenever the Godot Editor encounters a new resource (e.g. as a result of loading one from a resource file), it should check if the UID of the resource matches any known UID (i.e. one that's already associated with a different resource), and display a warning message if it does.
This simple improvement should prevent lots of future headache for many unsuspecting developers.
Beta Was this translation helpful? Give feedback.
All reactions