GetActorLocation() not showing y-coordinate in the output log

// Called every frame
void UMover::TickComponent(float DeltaTime, ELevelTick TickType, FActorComponentTickFunction *ThisTickFunction)
{
	Super::TickComponent(DeltaTime, TickType, ThisTickFunction);

	AActor *Owner = GetOwner();
	FString Name = Owner->GetActorNameOrLabel();
	FVector Location = Owner->GetActorLocation();
	FString locationString = Location.ToCompactString();

	UE_LOG(LogTemp, Display, TEXT("Mover Owner: %s with location %s"), *Name, *locationString);

	// ...
}

In the output log it’s showing the x-coord but, not the y-coord for some reason. Not a huge deal at the moment, just curious as why this would happen.

You are using ToCompactString() which excludes zero values. If you want all 3 regardless of their value you want ToString()

1 Like

Thanks, I’ll give it a try and see what the root locations are.

Awesome, thanks! I didn’t even notice both the pillar and the door roots fell on the y and z coordinates of 0.

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms