runyonave
(runyonave)
1
I am not sure what is going on here, I have the following components in a Pawn blueprint:

I am trying to add a pitch to the PlayerSceneComponent. When I set the following in either in BeginPlay or Tick:
PlayerSceneComponent->SetRelativeRotation(FRotator(0.f, 45, 0.f));
The scene component rotates on the Yaw and NOT on Pitch.
If I set it in the blueprint:

Then the component rotates on the pitch.
Is there something that is different about how SetRelativeRotation is handled on the c++ side that I am missing?
3dRaven
(3dRaven)
2
c++ in the documentation states that in the set relative rotation it takes in a FRotator that has a constructor
FRotator(float InPitch, float InYaw, float InRoll)
So if you want to rotate pitch then you need to set the first parameter to 45
if you are setting this in the tick function in c++ make sure that tick is enabled in the constructor
for actor:
PrimaryActorTick.bCanEverTick = true;
for component
PrimaryComponentTick.bCanEverTick = true;
runyonave
(runyonave)
3
Thank you so much! I should have referred to the manual regarding the FRotator. This solved the issue.