RealDocs

AActor::K2_GetActorLocation

function Engine Blueprint Since 4.0
#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
Event BeginPlay Set Actor Location Target is Actor Target New Location Sweep false Teleport false Return Value Get Actor Location Target is Actor Return Value Target Actor Target Actor Target Actor
Edit Blueprint graph Teleport a target actor to this actor's world location
Drag node headers to move · Drag from an output pin to an input pin to connect · Scroll to zoom · Right-click for actions
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

Version History

Introduced in: 4.0

Version Status Notes
5.6 stable

Feedback

Was this helpful?

Suggest an edit

Select a field above to begin editing.