Debug Message Error C2143

Hi,

I am trying to Show a debug message.

UEngine->AddOnScreenDebugMessage(-1, 5.f, FColor::Red, TEXT("Debug Message"));

Getting this Error:

error C2143: syntax error : missing
‘;’ before ‘->’

I’m not very sure but I think you must use GEngine instead of UEngine. and don’t forget to check if it is a valid pointer (bad things happen if you don’t check this particular pointer). so it must be something like this :

if(GEngine)
{
       GEngine->AddOnScreenDebugMessage(-1, 5.f, FColor::Red, TEXT("Debug Message"));
}