- Home /
Updating assets changes .meta files and breaks dependencies.
[UPDATE] I experimented and found out that the problem was caused by the .meta files changing what ID number it assigns to the root node. I'm guessing that means that this problem only applies to people using external version control? We'll be changing to the Unity Asset Server soon, and can try testing to see if this is still a problem.
We noticed a problem where when we updated an asset by reexporting the FBX from Max, that all the links to that object were broken. Is there a way around this?
I'm not sure if this is related or not, but we had to change the material generation method to be "per material" in order for the materials to update properly.
Here's a more detailed explanation of how the asset is linked. I have an Asset A, which is just sitting in some asset folder. I then create a Prefab P. I attach a script component S to P where S has a public GameObject member called AssetTemplate. I then go and link the asset A to AssetTemplate under the prefab and everything works fine. However once I make a change to Asset A, all of a sudden AssetTemplate under the prefab is now pointing to "Missing".
To clarify, I'm referring to the dependencies in prefabs that are linked to the asset.
by "broken", do you mean meshes that previously referred to the imported model become "$$anonymous$$issing" in the inspector? That should only happen if the model mesh names change.
I have a script in a prefab that attaches a GameObject(as specified in a link) to the object. That link was set to the the asset. When the asset got updated, the GameObject link was changed to "$$anonymous$$issing".
@sharat, the way those Q&A sites work is you edit questions or answers only to add relevant information to the question or to the answer, and not to add an actual answer inside the question, if you know what I mean. Your edit should've been an answer. And it's ok - even encouraged - to answer your own questions. ;-)
Answer by Borgo · Jul 08, 2011 at 05:21 PM
When you attach a script to the object, this object lost its link to the prefab (you can apply the altered settings to prefab) and lost its link with FBX "Tree".
So, when you make any change to model, in your 3D application, and Unity reimport this model, it will apply the mesh modifications, but if you add or delete any mesh in the FBX it will not apply this change to your object, because he lost its link.
There's no way to prevent this, what I do is to add the scripts By scripts while testing, and lastly attach the scripts directly to the object when finish.
Sorry for my bad gramar. Hope can help you. Borgo
The thing is that all of this is done within prefabs. The prefab itself is instantiated at runtime where it looks up the asset I specified and adds it to the scene with it.
Here's the scenario. I have an Asset A, which is just sitting in some asset folder. I then create a Prefab P. I attach a script component S to P where S has a public GameObject member called AssetTemplate. I then go and link the asset A to AssetTemplate under the prefab and everything works fine. However once I make a change to Asset A, all of a sudden AssetTemplate under the prefab is now pointing to "$$anonymous$$issing".
All of this is done outside of a scene, this is just changing the prefab relations.