Any ideas why this would happen?
Check your path to the material. Are you for some reason destroying the material. Just to make sure I understand what your saying, you say that you drag a material over to the inspector of a prefab, run the game, then the material is gone after run time?
At what point of running the game does it get destroyed ? (ie) Right away or after some event in the scene.
Have you tried to create a new project and or new scene with simple prefab to see if your problem is isolated to the one project?
If your prefab’s material name like [ ***(instance) ],
then you delete the prefab in the hierarchy pannel, then the prefab lose the material.
this maybe a possible scenario.
I create a gameobject (a cube) in the scene and drag a material to it in the inspector. (Actually, there are four of these.) Then I drag the cubes individually from the scene hierarchy into the project folders, making them prefabs. Then I reference these prefabs in code. I save the project and the scene. (I’ve also then deleted the gameobjects from the scene hierarchy since there are prefabs now.) Then I play the scene in Unity, and when I click the play button again later after some game code processing to stop the game, the prefabs are just cubes with no materials.
I haven’t tried to test another project situation yet. Are you saying that there might be project settings that cause this?