Skip to content

Instantly share code, notes, and snippets.

@MyelinsheathXD
Last active July 7, 2024 13:54
Show Gist options
  • Save MyelinsheathXD/3d3226fc956fad7842f140d3c0208713 to your computer and use it in GitHub Desktop.
Save MyelinsheathXD/3d3226fc956fad7842f140d3c0208713 to your computer and use it in GitHub Desktop.
UE log console and Screen
//Pars: id, seconds, color, text
FString st1=FString::FromInt(8572);
st1+=L"Hello world";
GEngine->AddOnScreenDebugMessage(-1, 5.f, FColor::Red, TEXT("Screen Message"));
//with id
GEngine->AddOnScreenDebugMessage(0, 1, FColor::Red, TEXT("HI"));
GEngine->AddOnScreenDebugMessage(76867, 3, FColor::MakeRandomColor(), FString::FromInt(8572));
GEngine->AddOnScreenDebugMessage(76867, 5, FColor::MakeRandomColor(), FString::SanitizeFloat(3.141592f));
UE_LOG(LogTemp, Warning, TEXT("Some message") );
FName MyName;
UE_LOG(LogTemp, Warning, TEXT("My Name: %s"), *MyName.ToString());
UE_LOG(LogTemp, Warning, TEXT("The integer value is: %d"), YourInteger);
UE_LOG(LogTemp, Warning, TEXT("The float value is: %f"), YourFloat);
UE_LOG(LogTemp, Warning, TEXT("The vector value is: %s"), *YourVector.ToString());
//Multiple
UE_LOG(LogTemp, Warning, TEXT("Current values are: vector %s, float %f, and integer %d"), *YourVector.ToString(), YourFloat, YourInteger):
//there is FString::Append() as well
#include "DrawDebugHelpers.h"
DrawDebugLine(GetWorld(), traceStart, traceEnd, FColor::Green, true, 1.0f);
DrawDebugLine(GetWorld(), T1.TransformPosition(FVector::ZeroVector),
T2.TransformPosition(FVector::ZeroVector), FColor::Green, true, 100.0f,0,10.0f)
tring name = "John";
FString greeting = "Hello, ";
greeting.Append(name);
// greeting now equals "Hello, John"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment