I have data stored on my actor and that data changes over time based on user actions for that specific instance of the actor. One of the data members I have should determine the material overlay base color. However, I am having trouble getting the actor to reference the material overlay in C++. This is about as far as I have gotten with code that isn’t failing to compile:
APointActor::APointActor()
{
FString DefaultTroopCount = "TroopCountText";
TroopTextComponent = CreateDefaultSubobject<UTextRenderComponent>(*DefaultTroopCount);
TroopTextComponent->SetText(FText::FromString("0"));
FString StaticMeshComponentName = "StaticMeshComponent";
StaticMesh = CreateDefaultSubobject<UStaticMesh>(*StaticMeshComponentName);
}
I figured out how to do it for normal materials but not the overlay material. How do I get the material overlay material instance or bind the data member color to the material overlay instance color?