UKismetMathLibrary::Vector_ToDegrees
#include "Kismet/KismetMathLibrary.h"
Access: public
Specifiers: staticUFUNCTIONBlueprintPure
Description
Converts each component of a vector from radians to degrees, returning (X*180/PI, Y*180/PI, Z*180/PI). Useful when converting radian-based angle results back into a degree-based Euler vector.
Caveats & Gotchas
- • This is a component-wise multiply by 180/PI. It is only meaningful when the vector stores radian angle values — not for direction or position vectors.
- • UE's FRotator and most rotation APIs expect degrees, so use this when bridging from a radian-returning API (e.g. atan2) back to an FRotator.
- • Pair with Vector_ToRadians for the reverse conversion. Converting back and forth repeatedly accumulates floating-point error.
Signature
static UE_INL_API FVector Vector_ToDegrees(FVector A); Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| A | FVector | A vector whose components represent angles in radians. | — |
Return Type
FVector Example
Convert atan2 radian results into an FRotator C++
// Suppose you computed angles in radians from some external source
FVector AnglesRad(PitchRad, 0.f, YawRad);
FVector AnglesDeg = UKismetMathLibrary::Vector_ToDegrees(AnglesRad);
FRotator Rot(AnglesDeg.X, AnglesDeg.Z, 0.f); Version History
Introduced in: 4.0
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?