RealDocs

UKismetSystemLibrary::PrintText

function Engine Blueprint Since 4.0
#include "Kismet/KismetSystemLibrary.h"
Access: public Specifiers: staticUFUNCTIONBlueprintCallableCallableWithoutWorldContextDevelopmentOnly

Description

Prints a debug FText to the screen and/or the Output Log. Functionally identical to PrintString but takes localizable text instead of a plain string.

Caveats & Gotchas

  • Marked DevelopmentOnly — every call compiles out entirely in Shipping and Test builds.
  • The default parameter uses INVTEXT, an invariant literal with no localization key — pass a properly localized FText (e.g. via NSLOCTEXT) if the message should actually be translated.

Signature

static void PrintText(const UObject* WorldContextObject, const FText InText = INVTEXT("Hello"), bool bPrintToScreen = true, bool bPrintToLog = true, FLinearColor TextColor = FLinearColor(0.0f, 0.66f, 1.0f), float Duration = 2.f, const FName Key = NAME_None)

Parameters

Name Type Description Default
WorldContextObject const UObject* Object used to resolve the World the message is printed in.
InText const FText The text to print. INVTEXT("Hello")
bPrintToScreen bool Whether to show an on-screen debug message. true
bPrintToLog bool Whether to also write the message to the Output Log. true
TextColor FLinearColor Color of the on-screen text. FLinearColor(0.0f, 0.66f, 1.0f)
Duration float How long the on-screen message stays visible, in seconds. A negative value falls back to the duration configured in Engine.ini. 2.f
Key const FName If non-empty, a later call with the same key replaces the previous on-screen message instead of adding a new line. NAME_None

Return Type

void

Example

Basic debug print with FText C++
UKismetSystemLibrary::PrintText(this, FText::FromString(TEXT("Quest complete")), true, true, FLinearColor::Green, 5.0f);

Version History

Introduced in: 4.0

Version Status Notes
5.6 stable

Feedback

Was this helpful?

Suggest an edit

Select a field above to begin editing.