UKismetMathLibrary::Vector_UnwindEuler
#include "Kismet/KismetMathLibrary.h"
Access: public
Specifiers: staticUFUNCTIONBlueprintCallable
Description
When a vector contains Euler angle values (in degrees), clamps each component to the range +/-180 degrees. Useful when accumulating rotations stored as raw degree vectors to prevent angle wrap-around issues.
Caveats & Gotchas
- • This modifies the vector in-place (passed by ref). The function returns void, so in Blueprint it must be wired as an exec node, not a pure getter.
- • This is only meaningful when the vector is being used to store Euler angles — calling it on a position or direction vector will produce incorrect results.
- • Does not normalize the FRotator-equivalent; use FRotator::GetNormalized() for rotator normalization instead.
Signature
static UE_INL_API void Vector_UnwindEuler(UPARAM(ref) FVector& A); Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| A | FVector& | A vector storing Euler angles in degrees. Modified in-place so each component is within +/-180. | — |
Return Type
void Example
Keep accumulated pitch/yaw/roll in range C++
// Accumulate angular velocity over time
FVector EulerAngles = CurrentAngles + AngularVelocity * DeltaTime;
// Prevent values from growing beyond +/-180
UKismetMathLibrary::Vector_UnwindEuler(EulerAngles); See Also
Version History
Introduced in: 4.0
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?