RealDocs

UKismetMathLibrary::Quat_GetAngle

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

Description

Returns the rotation angle of the quaternion in radians. This is twice the arc-cosine of the W component for a unit quaternion.

Caveats & Gotchas

  • The result is in radians, not degrees. Multiply by (180.f / PI) or use FMath::RadiansToDegrees() before displaying to users or comparing against degree-based thresholds.
  • For the identity quaternion (no rotation) the returned angle is 0. For quaternions representing the same rotation with opposite sign convention (e.g., Q and -Q), both return the same positive angle — the double-cover property of quaternions does not affect this.

Signature

static UE_INL_API float Quat_GetAngle(const FQuat& Q);

Parameters

Name Type Description Default
Q const FQuat& The quaternion whose rotation angle to retrieve.

Return Type

float

Example

Check rotation magnitude before applying C++
FQuat DeltaQuat = TargetQuat * GetActorQuat().Inverse();
float AngleRad = UKismetMathLibrary::Quat_GetAngle(DeltaQuat);
float AngleDeg = FMath::RadiansToDegrees(AngleRad);

if (AngleDeg > 5.f)
{
    // Large rotation — apply gradually
}

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.