Check out example codes for "add on screen debug message ue4". It will help you in understanding the concepts better.

Code Example 1

//include needed
#include "Engine/Engine.h"

//Format
void AddOnScreenDebugMessage(uint64 Key, float TimeToDisplay, FColor DisplayColor, const FString & DebugMessage, bool bNewerOnTop, const FVector2D & TextScale);

//Example Code
Engine->AddOnScreenDebugMessage(0, 2, FColor::Green, TEXT("Example Message"));

//For more information vist "https://docs.unrealengine.com/en-US/API/Runtime/Engine/Engine/UEngine/AddOnScreenDebugMessage/1/index.html"

Learn ReactJs, React Native from akashmittal.com