- Home /
CollectDependencies Missing some dependencies
I have a prefabricated game object in my project tab that follows this model:
Main Object (GameObject)
+--Group_1_1 (GameObject)
| +-- Transform component
| +-- Mesh Collider component
| +-- Mesh Renderer component
| +-- Material
|
+--Group_2_1 (GameObject)
| +-- Transform ...
`-- ...
This model was produced using these steps programmatically:
1. Imported fbx
2. Instantiated it
3. Modified the scene instances
4. Added components for a collider, renderer, and its material
5. Built a prefab out of this game object.
6. I verified that when I'm done, the assets in my project view include all the sub
game objects and sub components.
I don't know any other way to produce a similar hierarchy of objects, the Unity game object does not have an "add child game object" function that I know of. It's interesting to notice though, you can get a list of the main game object's child components, but never a list of its children. The only way to get the list of children is by getting its child transforms, and using their gameobject property. Kind of inconvenient if you ask me, don't know why Unity is designed that way.
Anyways, when I save these into an asset bundle, and load them back, the Material I have saved on the child classes is lost. I think that all components I added were not included in the asset bundle. My function call to build the asset bundle uses the "CollectDependencies" option. I tried using "CompleteAssets", but then the assets are not even saved in the bundle.
How can I have the components I added to the prefab included in the asset bundle?
Your answer
Follow this Question
Related Questions
How to import the object from server to unity 2 Answers
Facebook integration with the latest version of FB 1 Answer
Asset Bundle Granularity 0 Answers
Asset Cross Platform Compatibility 0 Answers