Hello everyone,
I have a UMG-HUD-BP with a Button. The Hud works, my Instance of my Widget Class is created over C++ like [here] 1. The thing im trying to do is to change the Image of the Button over C++ with the following lines.
UButton* Button = (UButton*)CurrentWidget->GetWidgetFromName(TEXT("Slot_1"));
if (Button)
{
Button->WidgetStyle.Normal.SetResourceObject("Texture2D'/Game/Weapons/Crosshairs/T_Crosshair_Horizontal_M.T_Crosshair_Horizontal_M'");
// Button->WidgetStyle.Normal.ImageSize = FVector2D();
}
Visual Studio marks all in the braces after SetResourceObject as Error.
The arguement with type “const char” is incompatible with Parameter from type UObject.
Nothing i tried worked. Do i have to convert the pic somehow, like the BP-node MakeBrushFromTexture or what is wrong? I cant find a Solution Online, so i hope u guys have an idea.
Cheers Ande