UKismetMathLibrary::NotEqual_RotatorRotator
#include "Kismet/KismetMathLibrary.h"
Access: public
Specifiers: staticUFUNCTIONBlueprintPure
Description
Returns true if rotators A and B differ by more than ErrorTolerance in any component. This is the logical negation of EqualEqual_RotatorRotator.
Caveats & Gotchas
- • Like EqualEqual_RotatorRotator, comparison is per component rather than by quaternion equivalence — a 0° yaw and a 360° yaw are considered not equal even though they describe the same orientation.
- • The function returns true if any single component exceeds the tolerance, so a rotator that differs by 0.2° in Pitch only will still return true with the default tolerance of 0.0001°.
Signature
static UE_INL_API bool NotEqual_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
Drive interpolation only when rotation differs C++
if (UKismetMathLibrary::NotEqual_RotatorRotator(CurrentRot, TargetRot, 0.1f))
{
FRotator Interp = FMath::RInterpTo(CurrentRot, TargetRot, DeltaTime, 5.f);
SetActorRotation(Interp);
} Version History
Introduced in: 4.0
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?