Missing mesh and material in prefab

I have just begun to make this Libary of objects, which we will be able to import from other projects.
Until now, I haven’t really been using prefabs, but with the creation of this Object libary, I will.
So, I have read everything there is to read about the subject in the documentation, and I thought it made sense. But something isn’t as intuitive as believed, and now I realize I can’t get it to work as hoped.

I imported an fbx-file, a Lamp, and made some materials for it. Then I made 2 lights, a spot light, and a point light, which I positioned at the light bulb. Then I parented these three objects under one single gameObject, which I named “Lamp_PH23”. I then created a new prefab object, which I named “Lamp_PH23” as well, and then I dragged the Game object (with the three child-objects) into the prefab object. So far so good. It all seems right, and Unity seems happy with these procedures.

Now…how do I import this prefab, without problems? Because, if I create a NEW project, and then tries to import this prefab (from my objects libary) via the “import new asset” menu, I will get the prefab with a lot of problems. Firstly, the mesh is missing. It says “missing mesh” under the mesh filter component, and the same goes for all the materials.
Now, it seems the prefab doesn’t contain any information about where the materials are stored, as well as the mesh it self. So obviously I’m doing this the wrong way, even though this approach seems so logical and practical to me. I mean, I would like to be able to maintain all objects and materials from within one single project, and then these changes should apply to all our other projects, nice and easy…

How to do it properly?

“Import new asset” is for external objects like textures, meshes, etc. For things like prefabs, select it and then do Assets → Export Package. Then you can import it into another project with Assets → Import Package.

–Eric

Hmmm. Is this really the right way? I mean, sure, now it works, and I get all the stuff for this Prefab. As a copy:(…
If I use this prefab somewhere, with all the copied materials and stuff, and then go back to my original Objects Libary object, and change a material there, this won’t show in the new copy, because its materials are just copied versions of the original material in my Libary project scene…

So this is not what I’m looking for. I want to be able to use these prefab objects in many different projects, but only needing to change things one place, in the object libary…

Is this just not doable?

Yes. :slight_smile: You need some way to package together the metadata that Unity uses; you can’t do that just by copying a file. There isn’t a way to automatically have a prefab update across multiple projects that I can think of.

–Eric

That is very sad…:frowning: And I really don’t get why that is so hard.
I mean, all this prefab would have to do, was to link to some materials and meshes in one core libary project. Does Unity depend on the core concept, that everything has to be collected into each project folder structure? And if that’s the case, why?

I.e, when I export my fbx-file from 3ds max to the server, and then import it to Unity as a new asset, Unity automatically copies the fbx-file into the project folder, which makes it more tidious to update the fbx-file with new data. I have to, everytime I make changes and re-eksport, copy the new fbx file into the project libary, instead of just choosing “Reimport asset” in Unity.

Is there a way to get around this? To just have Unity linking to the files it imports? Because the same goes for textures, etc. I want to be able to have one core texture libary, so when I do changes to textures, these textures are seen in all projects, instead of having to manually copy the textures into the different projects…
Isn’t this normal procedure in other softwares?

Don’t misunderstand me, I love Unity. But parts of it seems…not thought through… It sure do something to tacle me in my efforts to optimize our workflows, sadly…

You can build multiple games out of a single project folder. It just means being tidy with your folders inside. Thats your solution. I actually like that I can select a single folder and know everythings in there and nothing is reliant on things elsewhere on my HD.

I cant see it being too much of a hassle really.

Get stuck in mate!
AaronC

1 Like

But it is…:wink:
For our specific use, it really is a problem. There might be 100 ways to do this, and I’m sure we’ll get it to work, but the best solution would be to have all our objects saved in one libary project, and then be able to get these into new projects, without copying any stuff, so these new objects(objects being both meshes, but also their materials/scripts/textures) would forever be linked to the original version. We thought the prefab would be the solution, but as it not seems to be able to find it’s material(or other components), once imported into another project, and we therefore need to export it as a package, we just get copies of its components and we will not be able to go back to the libary, change some stuff, and expect these changes to show in the other projects.