70. Getting Transforms in C++


#1

This works for me:

FString ObjectName = GetOwner()->GetName();
	FString ObjectPos = GetOwner()->GetActorLocation().ToString();
	UE_LOG(LogTemp, Warning, TEXT("%s is at %s"), *ObjectName, *ObjectPos);

The output is this:

LogTemp: Warning: SM_Chair_2 is at X=-390.000 Y=-20.000 Z=20.000
LogTemp: Warning: SM_Rock_5 is at X=-300.000 Y=300.000 Z=0.000