Dynamic Material Instance Can Be Set From The Mesh But Not The Reference?

What I’m Tring To Do: After replacing a mesh I create a Dynamic Material Instance for it and save a reference too it to a variable. I set a bool to true which triggers an FInterpTo to set the Scalar Parameter Value using this reference.

Problem: The Issue is that when I do this I can get that same scalar value and print out both and it shows the value is changing but nothing happens.

So, I tried to change the Color. I did this immediately after creating the Dynamic Material Instance and nothing happened either.

In the Image below you’ll see two nodes. The one with an X is the one that doesn’t work. However, if I get the Dynamic Material from the Mesh itself then it works.

Here is the Function I call on the Tick Event that interpolates the value:
Dynamic Material FInterpTo posted by Depredor | blueprintUE | PasteBin For Unreal Engine

Here is the Function where I set the mesh and create the dynamic material instance as well as setting the reference:
Spawn Marker Function posted by Depredor | blueprintUE | PasteBin For Unreal Engine

Any help would be appreciated, thanks.

Spawn marker is called before set marker transition I assume.

Have you stepped through spawn marker (F9) and confirmed that:

  • the static mesh you are retrieving is valid
  • get material at slot 0 is valid and contains the parameter timeline
  • Target SM DMI is valid during the function

Yeah, thanks for the response, man. I actually ended up finding out that creating a dynamic material instance isn’t enough, you have to assign that to your mesh as well. For some reason that just never crossed my mind.