Setting Text Color Crashes Engine

Hi, I have a class called MenuItem, which contains a UTextRenderComponent named TextRenderComp.

When I try this line, the editor crashes:

TextRenderComp->SetTextRenderColor(FColor::Red);

Using this line in the constructor doesn’t crash the engine however. Am I doing something wrong?

Thanks

Hello,

I have created a text render component, and initialized it in my Constructor as such:

TextRender = CreateDefaultSubobject<UTextRenderComponent>(TEXT("Text Render Component"));
	TextRender->SetText("Hello");

After this, on Begin Play, I have this line:

TextRender->SetTextRenderColor(FColor::Emerald);

Using this method, I’m not experiencing a crash. Could you please provide your full code relating to this text render component and explain what function you are attempting to change its color in?

Also, if you are getting a crash reporter window, or a callstack in Visual Studio, provide that as well. If it is the former, please provide your Machine ID from the window and ensure to hit Send & Close on the report.

Hi, I solved the problem. The object I was trying to call the method on was null, and as such the crash occured. Sorry for the annoyance!