Static Mesh uses Default Material in Standalone Game, but looks correct in Editor

I have several Static Meshes in my game that have the correct material in the Editor, and when I Play In Editor, however when I build out the game or play in Standalone Game, the Static Mesh will display the Default World Material. Any ideas on what could be causing this?

Correct in Editor and Play in Editor (PIE)

Displays Default World Material in Standalone Game and in a Cooked/Built Game

Make sure that all your assets are in the content folder of your project

Everything’s in the Content folder. I can access and edit all the materials that are doing this. They have the exact same settings as other Materials that render just fine. Nothing seems readily amiss; but something has to be causing this issue.

Hi Jonathan,

Can you provide some further clarification:

-What version of the engine are you currently using?
-Are you able to reproduce this consistently in a new project?
-If you apply another material to this mesh that is working (even if it’s not the material made for this mesh) will that work when you play in standalone mode?
-If you make a new material and apply that will that work?

Thank you!

I was able to fix the problem. When investigating the issue, following along the lines of [ Hobsons][1]'s questions, I discovered what I believe was the core issue: the file pathway to the asset was too long.

I tried to make a new Material in the same location as the Material that was not being displayed properly; but when I tried to make a new Material the Content Browser said the name of the file pathway to the asset was too long. In fact, even if I wrote just one character as the name of the asset it said it was too long.

Screenshot of the error message:

I fixed the problem by moving the Static Mesh, Material, and Texture file (they were all in the same folder) to a single folder inside the root Game folder.

For reference, here are the old the Content Browser file pathways for the assets that weren’t working:

Texture: Game/StaticMeshes/SM_MultiplyLevel/SM_CityBuildings/T_house2_tex

Material: Game/StaticMeshes/SM_MultiplyLevel/SM_CityBuildings/M_Material_20

More Info

After some further testing, I discovered I am able to import assets to the above referenced SM_CityBuildings folder, even though any assets I create come up with the ‘file pathway too long’ error when I try to name them.

And I am able to create any new Asset in the folder, even after the error message: by Right-clicking, selecting the asset to create, and then instead of entering a name I just left-click on the background of the Content Browser and the new asset is created with a default name. There is no indication there is an error after importing, or after left-clicking the Content Browser background to make the new Asset.