RealDocs

UKismetMathLibrary::InverseTransformLocation

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

Description

Transforms a position by the inverse of the supplied transform. For example, if T is an object's world transform, this converts a world-space position into that object's local space.

Caveats & Gotchas

  • This is the companion of TransformLocation — use it whenever you need the reverse conversion (world to local) rather than manually building an inverse transform.
  • Location is a point, not a direction, so translation is applied; use InverseTransformDirection instead if you're converting a vector that shouldn't be offset by T's origin.

Signature

static FVector InverseTransformLocation(const FTransform& T, FVector Location)

Parameters

Name Type Description Default
T const FTransform& The transform whose inverse is applied.
Location FVector The world-space position to convert into T's local space.

Return Type

FVector

Example

Convert a world-space hit location into an actor's local space C++
FVector WorldHitLocation = Hit.Location;
FVector LocalHitLocation = UKismetMathLibrary::InverseTransformLocation(GetActorTransform(), WorldHitLocation);

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.