RealDocs

UKismetMathLibrary::TransformLocation

function Engine Blueprint Since 4.0
#include "Kismet/KismetMathLibrary.h"
Access: public Specifiers: staticUFUNCTIONBlueprintPure

Description

Transforms a position vector by the supplied transform, applying rotation, scale, and translation. Typically used to convert a point from local space to world space given an actor's transform.

Caveats & Gotchas

  • Unlike TransformDirection, this function applies translation — the result is offset by the transform's location, so it is a full point transformation, not a vector direction transformation.
  • Scale is also applied: if T has a non-unit scale, the output position will be scaled relative to the transform's origin. Use InverseTransformLocation to reverse the operation.

Signature

static UE_INL_API FVector TransformLocation(const FTransform& T, FVector Location)

Parameters

Name Type Description Default
T const FTransform& The transform defining the space change (e.g. an actor's world transform).
Location FVector The position to transform, in the source space.

Return Type

FVector

Example

Convert a socket-local offset to world space C++
FTransform SocketTM = MeshComp->GetSocketTransform(FName("MuzzleSocket"));
FVector LocalOffset(50, 0, 0);
FVector WorldPos = UKismetMathLibrary::TransformLocation(SocketTM, LocalOffset);

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.