{ }Blueprint → C++

Unreal Engine 5 · Blueprint → C++

Get World Location of a Component in Unreal Engine 5 C++UE Docs

The Get World Location node for a component maps to USceneComponent::GetComponentLocation, which returns the component's current position in world space as an FVector.

Blueprint node & C++ equivalent

C++
FVector Location = MyComponent->GetComponentLocation();

The C++ equivalent

Read the world position with FVector Location = MyComponent->GetComponentLocation(). The returned FVector is in absolute world coordinates, already accounting for the full attachment chain and any parent transforms. There are no parameters; it simply reports where the component is right now.

For rotation or scale, the related calls are GetComponentRotation and GetComponentScale, or GetComponentTransform for everything at once.

When to use it in C++

Use GetComponentLocation to spawn effects, run a trace, or measure distance from a specific component such as a muzzle socket or a camera, rather than from the Actor origin. To get the Actor's pivot instead, call AActor::GetActorLocation.

Because it returns world space, the value is comparable directly with other world locations and hit results.

Frequently asked questions

How do I get a component's world location in UE5 C++?+

Call MyComponent->GetComponentLocation(), which returns an FVector in world space.

What is the difference between GetComponentLocation and GetActorLocation?+

GetComponentLocation returns the position of a specific component, while GetActorLocation returns the owning Actor's root location. They differ whenever the component is offset from the root.

Related Components nodes

View all Components nodes →