Hi!
I’m using Unreal 5.4.2.
I’m using the SM_Cube_01 Static Mesh from the VR Template content in an Actor.
With the material instance MI_Cube_01:
I want to change the Value of the GlowColor with this code:
TObjectPtr<UMaterialInstanceConstant> Mat_Inst = Cast<UMaterialInstanceConstant>(StaticMesh->GetMaterial(0));
if (Mat_Inst)
{
FMaterialParameterInfo ParameterInfo(FName("GlowColor"));
Mat_Inst->SetVectorParameterValueEditorOnly(ParameterInfo, CubeColour);
}
I have many actors on the level that uses this Static Mesh. When I change the parameter value, it changes in all of the actors in the level.
How can I change this parameter value?
I’ve used this node in Blueprint and it works perfectly: