Different approaches for getting an Actor Location

Hello everyone

After reading several functions in the UE documentation and also checking different ideas, I came up with these different approaches to obtain the Actor location coordinates. Indeed there are several ways to do it.

Please let me know if you can find a different one from the ones I tried.

Cheers.

3 Likes

Awesome job coming up with different approaches! :100:

1 Like

Here is my Different Solution from Mike:

void UWorldPosition::BeginPlay()

{

Super::BeginPlay();

FString ObjectName = GetOwner() -> GetName();

FVector ActorVector = GetOwner()->GetActorLocation();

UE_LOG(LogTemp, Warning, TEXT("%s is positioned at X = %f, Y = %f, Z = %f"),*ObjectName, ActorVector.X, ActorVector.Y, ActorVector.Z);

}

1 Like

Privacy & Terms