UKismetMathLibrary::EqualEqual_RotatorRotator
#include "Kismet/KismetMathLibrary.h"
Access: public
Specifiers: staticUFUNCTIONBlueprintPure
Description
Returns true if rotators A and B are equal within ErrorTolerance per component. Exposed to Blueprint as the == operator for rotators.
Caveats & Gotchas
- • Comparison is per-component (Pitch, Yaw, Roll individually), not based on quaternion equivalence — two rotators that produce the same orientation but differ by 360° in a component will compare as not equal.
- • The default tolerance (0.0001°) is tight enough to catch floating-point drift from math operations, but may give false negatives if rotators were accumulated over many frames.
Signature
static UE_INL_API bool EqualEqual_RotatorRotator(FRotator A, FRotator B, float ErrorTolerance = 1.e-4f); Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| A | FRotator | First rotator. | — |
| B | FRotator | Second rotator. | — |
| ErrorTolerance | float | Per-component tolerance in degrees. | 1.e-4f |
Return Type
bool Example
Check if rotation has reached target C++
FRotator Target(0.f, 90.f, 0.f);
if (UKismetMathLibrary::EqualEqual_RotatorRotator(GetActorRotation(), Target, 0.5f))
{
// Close enough — snap to exact target
SetActorRotation(Target);
} Version History
Introduced in: 4.0
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?