How to get Actor Pitch and Yaw using C++

A lot easier than in Blueprints to be honest…

UActorPointer->SetActorRotation(FRotator(pitch, yaw, roll));

SetActorRotation can also use Quaternions, just use FQuat.

FRotator DeltaRotation = GetControlRotation() - GetActorRotation();
SetPitch(DeltaRotation.Pitch);
SetYaw(DeltaRotation.Yaw);

I don’t know what is this FPSCharacter is (or else you use old FPS demo?), this is not part of first person template. So i assume those functions exists in C++ class, but keep in mind there might blueprint only events.

Note that substracting rotators and vectors in C++ create diffrence (delta) value between two of them.

Here general tip on conversion. You already may notice this by looking on my code, names of nodes matches the names of C++ functions. This is because most nodes in Blueprints (i guess around 90% of them) are just bindings of real functions in C++, so you can easily find equivalent of one another. The “Target” pin type in node indicates in which class function is, if nothing is unpluged to “Target” node it’s equivlent of calling function inside the class the code is executed or using this->.

So use documentation search to find C++ functions equivlent (again they not really equivlent, they are same functions) to blueprint nodes, type name of the node and remove spaces, then in results click C++ API and you will see list of C++ function in API refrence (your bible in to C++, learn how to use it and you will save lot of time insted asking questions here):

Hi, I know this is a dumb question but I just today wanted to start learning C++ with UE4 and I wanted to make this in c++ any ideas how I could make this ?