UKismetMathLibrary::MakeRotFromYX
#include "Kismet/KismetMathLibrary.h"
Access: public
Specifiers: staticBlueprintPure
Description
Builds a rotator with Y as the fixed primary axis and X adjusted to be orthogonal. Z is computed from the cross product. Useful when right-axis alignment is more important than forward direction.
Caveats & Gotchas
- • Argument order is (Y, X) — the primary (fixed) axis comes first; confusing the order with MakeRotFromXY will produce a mirrored or incorrect orientation.
- • Like all two-axis constructors, parallel inputs give a degenerate result.
Signature
static UE_INL_API FRotator MakeRotFromYX(const FVector& Y, const FVector& X); Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| Y | const FVector& | Primary (fixed) right axis. | — |
| X | const FVector& | Secondary forward axis, adjusted for orthogonality. | — |
Return Type
FRotator Example
Align a vehicle wheel to a lane direction C++
FVector LaneRight = LaneSpline->GetRightVectorAtSplinePoint(PointIdx, ESplineCoordinateSpace::World);
FVector ForwardHint = LaneSpline->GetDirectionAtSplinePoint(PointIdx, ESplineCoordinateSpace::World);
FRotator WheelRot = UKismetMathLibrary::MakeRotFromYX(LaneRight, ForwardHint); Tags
Version History
Introduced in: 4.0
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?