So I got a little sidetracked with the logging

Now I’ve got ingame logging :slight_smile:

#define LOG_TO_SCREEN(Text) \
	GEngine->AddOnScreenDebugMessage(-1, 5.f, FColor::White, (TEXT("%s"), (FString)Text));

void UWorldPosition::BeginPlay()
{
	Super::BeginPlay();

	TArray<FStringFormatArg> args;
	args.Add(FStringFormatArg(GetName()));
	args.Add(FStringFormatArg(GetOwner()->GetName()));

	FString Test = FString::Format(TEXT("Component: {0} - Object Name is: {1}"), args);

	UE_LOG(LogTemp, Warning, TEXT("%s"), *Test);
	LOG_TO_SCREEN(*Test);
}

1 Like

Privacy & Terms