So I’m testing this on a simple cube object. The parent material has a single scalar parameter called “RedEmissive” and it makes the material glow red. I test changing this parameter in the Material editor and it works fine.
I make an instance of this parent material. I apply this instance material to the mesh in the editor. I use this mesh as the
Mesh component on my object blueprint. In the C++ class for this object I do the following:
MyClass.h UPROPERTY() UMaterialInstanceDynamic* MI_ObjectMat; MyClass.cpp // in the constructor MI_ObjectMat = Mesh->CreateAndSetMaterialInstanceDynamic(0); // in some other function that gets called PRINT_SCREEN("SET RED"); MI_ObjectMat->SetScalarParameterValue(TEXT("RedEmissive"), 0.5f);
Now, I see
SET RED getting printed to screen, but the color doesn’t change.
What am I doing wrong here… this seems very straight forward.