Closed lexusinator closed 3 years ago
Again, awesome repro steps. 🙂
I believe I remember trying this one time, but maybe I didn't reimport while doing this.
But this is generally a limitation of the import process; if any GameObjects are siblings in their import hierarchy and have the exact same name, then the import system can't correlate identifiers, which affects how unity might track scene/prefab overrides for which object to maintain the overrides for in the occurence of a reimport. (This also happens if multiple of the same component are in a gameobject, like two box colliders for example)
The problem is inconsequential as long as no scene/prefab overrides are used for those specific objects in question, but I can understand if the logs are bugging you. 😅
I'll check this out and see what I can do, but I can't guarantee if this is truly fixable 😅
I think I could create a documentation topic about this, in case this might ever happen to anyone. I can predict that people might use multiple components in an entity prefab, so explaining that detail would be helpful 🙂
Ahh, I see! Weird how that works. Actually I wanted to use overrides on that object, but I guess I won't. 😅 Yeah a note in the documentation is a good idea!
Testing and I found an extra problem related to this. I've done the repro steps, and then further tried dragging a prefab using the .ldtk prefab into a scene. It results in this which is definitely not expected.
Inside the prefab content, it's working correctly. However, It's not turning out correctly in the scene.
So I'm going to see if I can find a solution to this import pipeline problem 🙂
I think it might be some sort of problem due to how gameobjects are created during the import process. I'm curious how Unity specifically does theirs potentially differently (FBX for example) to create their gameobjects into their import result.
I think I found my solution. The error was happening even before the import process was happening. So I think the problems were coming because prefabs were being imported before the LDtk projects were.
By changing the LDtk project's importer's importQueuePriority
, it now imports before prefabs do, and that fixed it, no more log warnings 😄
So what I believe was happening is that because the LDtk project was placed in a prefab, the LDtk project now becomes a dependency of the prefab, so that means that reimporting the LDtk project also means that the prefab gets reimported. And so because the prefab was being reimported first, It didn't know how to exactly deal with the old LDtk project (because the LDtk project still needed to be reimported next).
So consider this fixed. This will come in the next update. Will close this issue when the update comes 🙂
Oh wow, awesome that you found a fix for that, that's a big one! 😊
The 2.1.4 update is now up which has a few bug fixes and better text contrast behind certain colors 👍 Feel free to post more issues if you have any 🙂
Summary
If your LDtk asset is part of a prefab, the importer will log warnings that names are not unique and that subsequent imports may not properly re-link.
Steps to reproduce
1. Add a LDtk asset under an empty parent object, make that parent object a prefab.
2. Reimport the LDtk asset.
Warnings are logged to the console.
Stuff that might help
Warnings logged to the console: