Is there anythinbg wrong with GetActorLocation?

Hey all, I was able to complete the challenge for the Getting Transforms in C++ video, however I used a different set of code (see below):

FString ObjectPos = GetOwner()->GetActorLocation().ToString();

I see a lot of discussion about this has already taken place, and I’ve gotten the impression that it doesn’t matter what method you use… That said I wanted to ask, is it better to use GetActorLocation().ToString() or GetTransformation().GetLocation().ToString()? I saw something about GetActorLocation being slightly faster (maybe), but does anyone know if this is true?

Thanks, and good luck!

1 Like

I think GetActorLocation would be okay and more better to use because GetTransformation has more attributes like GetRotation and GetScale.

1 Like

This is actually what I came up with before reviewing what he had come up with after the challenge too, great job finding alternatives.

Yep me too but GetTransformation as pointed out by David is much richer or at least has more information.
FString PositionMessage = GetOwner()->GetActorLocation().ToString();

Privacy & Terms