RealDocs

UKismetMathLibrary::InverseTransformRotation

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

Description

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

Caveats & Gotchas

  • This is the companion of TransformRotation — use it to recover the local-space rotation that, when combined with T, produces the given world rotation.
  • Only T's rotation component matters; location and scale don't influence the result.

Signature

static FRotator InverseTransformRotation(const FTransform& T, FRotator Rotation)

Parameters

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

Return Type

FRotator

Example

Recover an attachment's local rotation from a world rotation C++
FRotator WorldTargetRotation = OtherActor->GetActorRotation();
FRotator LocalRotation = UKismetMathLibrary::InverseTransformRotation(GetActorTransform(), WorldTargetRotation);

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.