C++ equivalent of 'GetRotationXVector'

FRotator MyRot;
FVector RotXVector = MyRot.Vector();

Hi.

I’m “translating” this Blueprint nodes in C++:

I’m looking for the GetRotationXVector equivalent in C++.

Hi gedamial,

Try with GetControlRotation().Vector();

If you have the Engine Source Code you can always search for the implementation of some Node. In this case you have this Node inside KismetMathLibrary.h Engine/Source/Runtime/Engine/Classes/Kismet/KismetMathLibrary.h

UFUNCTION(BlueprintPure, meta=(DisplayName = “GetRotationXVector”, Keywords=“rotation rotate cast convert”, BlueprintAutocast), Category=“Math|Rotator”)
static FVector Conv_RotatorToVector(FRotator InRot);

and the implementation is ease:
FVector UKismetMathLibrary::Conv_RotatorToVector(FRotator InRot)
{
return InRot.Vector();
}

Best regards

Hey thanks very much for the detailed answer!

+1

Thanks man!