RealDocs

UKismetMathLibrary::Conv_RotatorToVector

function Engine Blueprint Since 4.0
#include "Kismet/KismetMathLibrary.h"
Access: public Specifiers: staticUFUNCTIONBlueprintPure

Description

Converts a rotator to its forward direction unit vector (X axis). This is identical to GetForwardVector and is the autocast used in Blueprint when you connect a Rotator pin to a Vector pin.

Caveats & Gotchas

  • Because this is the Blueprint autocast, connecting a Rotator wire to a Vector input in Blueprint silently calls this function — be aware when porting Blueprint logic to C++ that a Rotator-to-Vector wire does not pass all three angle components, only the forward direction.
  • The function discards Yaw entirely for the Z-component calculation — the resulting Z equals sin(-Pitch), so two rotators with the same Pitch but different Yaw produce vectors with identical Z but different XY.

Signature

static UE_INL_API FVector Conv_RotatorToVector(FRotator InRot);

Parameters

Name Type Description Default
InRot FRotator The rotation to convert to a direction vector.

Return Type

FVector

Example

Get a direction vector from a look rotation C++
FRotator AimRot = GetControlRotation();
FVector AimDir = UKismetMathLibrary::Conv_RotatorToVector(AimRot);
FVector TraceEnd = GetActorLocation() + AimDir * 10000.f;

Version History

Introduced in: 4.0

Version Status Notes
5.6 stable

Feedback

Was this helpful?

Suggest an edit

Select a field above to begin editing.