AActor::K2_GetActorLocation
#include "GameFramework/Actor.h"
Access: public
Specifiers: constUFUNCTIONBlueprintCallable
Description
Returns the world-space location of the actor's RootComponent. This is the Blueprint-exposed version of GetActorLocation, surfaced as 'Get Actor Location' in Blueprint graphs.
Caveats & Gotchas
- • In C++, prefer calling GetActorLocation() directly — K2_GetActorLocation is an inline wrapper that calls it, but naming clarity is better with the non-K2 variant in native code.
- • Returns FVector::ZeroVector if the actor has no RootComponent; this is indistinguishable from a valid world-origin position, so check for a valid root component if this matters.
Signature
FVector K2_GetActorLocation() const Return Type
FVector Examples
Teleport a target actor to this actor's world location
Blueprint
Get actor location in C++ C++
// Typically called via the non-K2 alias in C++:
FVector Loc = GetActorLocation();
// K2_GetActorLocation is the underlying implementation:
FVector Loc2 = K2_GetActorLocation(); // identical result Tags
Version History
Introduced in: 4.0
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?