Difference in Getting Position

Hey there. I missed on the linking option in transforming the vector into a string so I wrote it like this:

// Called when the game starts
void UPositionReport::BeginPlay()
{
Super::BeginPlay();

FString ObjectName = GetOwner()->GetName();
FVector ObjectVector = GetOwner()->GetActorLocation();
FString ObjectPos = ObjectVector.ToString();

UE_LOG(LogTemp, Warning, TEXT("%s is at %s"), *ObjectName, *ObjectPos);

}

What I am wondering is, other than the fact that I declared an extra variable and made the program more robust for nothing, what, if any difference in performance are there? And are there other unwanted side effects with the way I wrote the code?

There should be no performance difference or unwanted side effects, it is perfectly fine.

Privacy & Terms