How can I print an onscreen bool value?

Hey, just saw your question. I don’t know if you still have the problem, but if someone else runs into this problem, try doing it like this:

if (GEngine)
	{
		GEngine->AddOnScreenDebugMessage(-1, 10.f, FColor::Black, FString::Printf(TEXT("Bool: %s"), bMyTestBool ? TEXT("true") : TEXT("false")));
	}

Also for you UE_LOG print, try adding

TEXT("true") : TEXT("false")

instead of only “true” and “false”

11 Likes