How to get rotation x vector

Disclaimer: I am a total noob.

image
I am trying to find any equivalent of this node, but the only details online are the documentation

The closest i have gotten is

FVector TestVar = FRotator::Vector (GetActorRotation());

However this then says function does not take 1 arguments. How does this even work if theres nowhere to put a rotator? Or does it take multiple inputs? Trying to stumble around documentation of dubious quality, and sparse tutorials is getting really annoying, usually theres a tutorial if i dig around, but I have hit a wall here. I follow the source directory in some hope of finding something that could help me guess the answer, but all i find is… a windows media file???

Im not at the computer at the moment to test, but I believe when you make rotator you have to break the struct pin to get the x y z axis’ and may have to break the return value to get the x value to plug it into.

What you are doing here:

FVector TestVar = FRotator::Vector (GetActorRotation());

Is statically referencing the Vector member function of FRotator class. While there is a method named Vector in this class, it is not static. If you want to get a vector from a rotation, you would do something like this:

FVector TestVector = GetActorRotation().Vector();

In terms of an equivalent to the node you have in the screenshot, perhaps this is what you are looking for?

Yes it is what i am looking for, thanks.

Total failure on my part. The link I had sent is the wrong documentation page, and still points to a Blueprint node document. Please disregard :slight_smile:

Assuming you can get the actor rotation using GetActorRotation(), you can construct an FVector from it while only setting the value for X, 0.0f for the other two:

FVector xVector{GetActorRotation().Roll, 0.0f, 0.0f};

I believe this should be the equivalent of GetRotationXVector node, if I am understanding correctly.

Your updated code is wrong (at least, it’s not the same thing as the BP function) but the implementation of GetRotationXVector is pretty simple. What you want is just GetActorRotation.Vector().

Not arguing since I am new to the Unreal API. Just wondering why the node is named GetRotationXVector. Specifically, presence of X in there made me think it wouldn’t just return the vector as-is.