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:
The only way for me to get it to work is to create the dynamic material instance using the BeginPlay event:
Should I not expect this node to work in the construction script? Or is it a bug?
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.
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.