Open shadowmage45 opened 6 years ago
Apparently this is a known and long-standing issue with Unity and Asset Bundles (not specifically caused by KSP or TexturesUnlimited) --
https://answers.unity.com/questions/23862/tag-on-a-gameobject-which-is-loaded-as-an-assetbun.html
https://forum.unity.com/threads/tags-and-assetbundles.132984/
It has been a problem since at least 2012, with no sign of resolution coming from the Unity devs.
Okay, so the solution is to ensure that your tag list in your Unity Editor exactly matches what is expected by KSP. Any mis-match in the ordering will result in the tags on the objects loaded from the asset-bundle being incorrect.
This is how you need to setup your tags in the Unity Editor in order to have them saved properly into the AssetBundles:
[LOG 16:47:40.526] Load(Model): /tagtest [LOG 16:47:40.531] Debug Output for Model: TagTest(Clone) [LOG 16:47:40.531] Transform: TagTest(Clone) Tag: Untagged Layer: 0 [LOG 16:47:40.531] Transform: Tag-0 Tag: GUIText Layer: 0 [LOG 16:47:40.531] Transform: Tag-1 Tag: SmartWater Layer: 21 [LOG 16:47:40.531] Transform: Tag-2 Tag: KSC Layer: 21 [LOG 16:47:40.531] Transform: Tag-3 Tag: LaunchPad Layer: 0 [LOG 16:47:40.531] Transform: Tag-4 Tag: Kerbin Layer: 0 [LOG 16:47:40.531] Transform: Tag-5 Tag: Mun Layer: 0 [LOG 16:47:40.532] Transform: Tag-6 Tag: Runway Layer: 0 [LOG 16:47:40.532] Transform: Tag-7 Tag: Ladder Layer: 0 [LOG 16:47:40.532] Transform: Tag-8 Tag: Airlock Layer: 0 [LOG 16:47:40.532] Transform: Tag-9 Tag: krakensbane Layer: 0 [LOG 16:47:40.532] Transform: Tag-10 Tag: Icon_Hidden Layer: 0 [LOG 16:47:40.532] Transform: Tag-11 Tag: Icon_Only Layer: 0 [LOG 16:47:40.532] Transform: Tag-12 Tag: NoAttach Layer: 0
[Click and drag to move]
Which looks like this in the editor (click on the 'Add Tag' button, and make sure your list matches this exactly) :
With the above setup completed in your editor install, make sure to fix the tags on your models (they likely were changed when you updated the values in the tag manager), recompile and/or re-export your .smf models (recreate the prefab, and re-build the asset-bundles).
After the tags have been fixed in your editor install, and your asset-bundle models rebuilt, they should then load fine in KSP. (at least my test model loads properly with the above changes having been made, and the asset-bundle for it rebuilt)
Debug output from an asset-bundle based model, that should have the 'Airlock' tag on the 'Airlock' transform.