Hi all,
I’m writing an editor script that does the following:
- create a gameobject
- create a mesh and assign it to the game object via MeshFilter and MeshRenderer
- create a material and assign to the mesh
- create an empty prefab and connect my newly created game object to this new prefab
Once this is done, I now have a prefab in my project’s assets folder, that contains a gameObject that has a mesh and material. This part works fine, I can see my instantiated prefab in the scene, just like I expect it, and create other instances if needed.
The problem is, when I close/reopen the project, the gameObject has lost its mesh ![]()
Same thing happens if I try to export the prefab as a unitypackage for another project, or export it as an assetbundle.
Am I missing something?
What I’m basically trying to do is create some prefabs with generated geometry, that I can then save in asset bundles for use in my project.
Tks for any help