DecalActor dynamic material instances

Dynamic material instances to not appear to be working correctly on Decal Components.

If I create a DecalActor and call the DecalComponent ‘CreateDynamicMaterialInstance’ node in its construction script, it creates a material instance, but that instance does not have the original decal material as a parent and so the decal appears as broken:

68603-decalcdmi.png

The only way for me to get it to work is to create the dynamic material instance using the BeginPlay event:

68605-beginplay.png

Should I not expect this node to work in the construction script? Or is it a bug?

same issue here

Yeah, I’m wondering why that is not working. Did you ever figure it out? Thanks

I found the answer! Thanks to Eric Ketchum’s helpful test project here, I discovered why the decal’s dynamic material instance would always show up as the default decal material inside the level. Apparently, you cannot have the decal as the root of the blueprint, which means you cannot have a dynamic material in a blueprint whose Parent Class is decal actor. You must first choose actor, then manually add a decal component. This is how Eric’s BP test project was setup, and this is the only way that works. Not sure if that’s by design, or a bug.

-Adam

I’m using a decal component which is not the root, but still the material instance created is the default one :frowning:

Is the parent class of your BP “Actor”? Check out Eric’s test project to see if you have any differences in setup with your own.

The parent of my BP is a C++ class i made, which indeed inherits from Actor. Never found out what the issue was, just created the dynamic material instance on PostInitializeComponents(). It however, only worked for the first material created, after that, the decal would use the default material as base. I just saved a reference to the first one.

Ah, okay. Well, I haven’t touched decal actors with C++ before, only with Blueprint. Sorry, I couldn’t help more with this one. Hope you find the solution.