Keep imported meshes reference in prefab

I have a Prefab with a Mesh Filter and various scripts, I also have a .blend file which Unity imports as a model (same problem with an .obj file) that I want to use in the Mesh Filter.

I take the imported mesh and drag it to the Mesh property of the Mesh Filter (or select the mesh via the asset browser). This works fine and the mesh is drawn correctly during play.

Then I end play, and start play again, and the Mesh is missing. How do I prevent this from happening?

In the comments I suggested that scripts messing with the mesh can cause such a problem.

Normaly, just reading a value such as gameObject.GetComponent().mesh.bounds.center shouldn’t cause any problems, though. Which component are you requesting in that call to GetComponent()? Is that script an Editor script/has an “ExecuteInEditMode”?

If you are certain you are merely reading that value, not modifying it, you can try whether using gameObject.GetComponent().sharedMesh.bounds.center solves your problem. But note that modifying anything in sharedMesh will modify the actual Asset in your project!

Also, I forgot to ask: did you drag the mesh in to the actual Prefab that sits in your “Project” view, or did you drag it into the instance of that prefab in your scene?