UKismetMathLibrary::GetRightVector
#include "Kismet/KismetMathLibrary.h"
Access: public
Specifiers: staticUFUNCTIONBlueprintPure
Description
Returns the world-space unit vector pointing in the right (Y+) direction for the given rotation. Equivalent to rotating FVector::RightVector by InRot.
Caveats & Gotchas
- • In UE's left-handed coordinate system, 'right' is the positive Y axis. This is the opposite convention from many other engines and 3D tools — do not assume +X is right.
- • For strafing movement, use this vector scaled by an input axis value and added to velocity, rather than trying to derive it from the forward vector via cross product (which introduces error for non-zero pitch).
Signature
static ENGINE_API FVector GetRightVector(FRotator InRot); Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| InRot | FRotator | The rotation to convert. | — |
Return Type
FVector Example
Compute a strafe impulse C++
FVector Right = UKismetMathLibrary::GetRightVector(GetActorRotation());
LaunchCharacter(Right * StrafeSpeed, false, false); See Also
Version History
Introduced in: 4.0
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?