How can I print an onscreen bool value?

I’m a little late, but you can create macro like this

#define BToS(b) b ? L"true" : L"false"

Or more correct

#define BToS(b) b ? TEXT("true") : TEXT("false")

So it will be just

GEngine->AddOnScreenDebugMessage(-1, 5.f, FColor::Red, FString::Printf(TEXT("Blocking Hit =: %s"), BToS(bBlockingHit)));
2 Likes