# C++ equivalent of 'GetRotationXVector'

**URL:** <https://forums.unrealengine.com/t/c-equivalent-of-getrotationxvector/340419>\
**Category:** Programming & Scripting\
**Tags:** unreal-engine\
**Created:** [December 3, 2015, 4:35pm UTC](https://forums.unrealengine.com/t/c-equivalent-of-getrotationxvector/340419 "2015-12-03T16:35:48Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![gedamial](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@gedamial](https://forums.unrealengine.com/u/gedamial)\
**Post date:** [December 3, 2015, 4:35pm UTC](https://forums.unrealengine.com/t/c-equivalent-of-getrotationxvector/340419/1 "2015-12-03T16:35:48Z")

</div>

Hi.

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

 ![69190-1.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/e/8/c/e8c5ae00ef50610e248f12e554122a8641d96b62.png)

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

---

<div class="post-metadata">

**Author:** ![Mhousse1247](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Mhousse1247](https://forums.unrealengine.com/u/Mhousse1247)\
**Post date:** [December 3, 2015, 4:46pm UTC](https://forums.unrealengine.com/t/c-equivalent-of-getrotationxvector/340419/2 "2015-12-03T16:46:30Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_a8366a311](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_a8366a311](https://forums.unrealengine.com/u/anonymous_user_a8366a311)\
**Post date:** [December 3, 2015, 4:49pm UTC](https://forums.unrealengine.com/t/c-equivalent-of-getrotationxvector/340419/3 "2015-12-03T16:49:08Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![gedamial](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@gedamial](https://forums.unrealengine.com/u/gedamial)\
**Post date:** [December 3, 2015, 5:00pm UTC](https://forums.unrealengine.com/t/c-equivalent-of-getrotationxvector/340419/4 "2015-12-03T17:00:41Z")

</div>

Hey thanks very much for the detailed answer!

+1

---

<div class="post-metadata">

**Author:** ![gedamial](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@gedamial](https://forums.unrealengine.com/u/gedamial)\
**Post date:** [December 3, 2015, 5:00pm UTC](https://forums.unrealengine.com/t/c-equivalent-of-getrotationxvector/340419/5 "2015-12-03T17:00:54Z")

</div>

Thanks man!
