Dynamic Material is always blank

So I have a material that generates a fairly simple planet with adjustable parameters, but the issue I’m having is that it won’t apply to the actor when it spawns at runtime. My construction script creates a material instance dynamic which attaches to the planet generation material as follows:

And then set the material when I run my planet creation function which goes as follows, starting from the level blueprint on BeginPlay:



So the material is set in the Init Planet function, but when I open up the game the planets have just a blank canvas where it says MaterialInstanceDynamic:

I’m not sure what the problem is, anyone have an idea?

Finding this thread while solving a related issue, leaving some notes in case someone else is led here as well. I would try;

  • Create the Dynamic Material Instance from Begin Play, not the Construction Script. I have had issues with Dynamic Mats in a construction script not being created at runtime. Just copy-paste the nodes into the Event Graph running from Begin Play and see if you get the desired result.
  • Confirm that your mesh only has a single material index (or that you are using the correct index in Create Dynamic Material).