Blueprints - PlayerCameraManager->getActorRotation() returns wrong rotation

EDIT: fixed some typos

Issue I’m having is that when trying to get camera rotation from a camera that is set up in editor it returns skewed rotation values.

I was able to reproduce this issue on blank project.

  1. create blank project.
  2. add 2 camera actors to persistent level.
  3. set 1st camera rotation to P:-89 Y:180 R:-90. set 2nd camera rotation to P:-90 Y:180 R:-90.
  4. in level blueprint add those camera actors from persistent level, get their respective actor rotations and print them out on begin play event.
  5. 1st camera with pitch value of -89 return rotation as expected P=-88.998672 Y=179.999893 R=-89.998825(approximately expected values), but the 2nd camera returns skewed rotation values: P=-90 Y=-3.576335 R=93.576340.

same thing happens if camera manager is accessed from Player controller via nodes getPlayerCameraManager->getActorRotation() or getPlayerCameraManager->getCameraRotation().

Question begs , why Yaw and Roll values differ from expected ones.

this does not interfere with my project as I can use Pitch value of 89.999001, which is really close to needed rotation and visually indistinguishable, and the rotation is returned as expected (with 0.1 degree deviation, which is acceptable in my case).

But a bug is a bug, so here is a report.

Using UE4 version: 4.17.1-3586342+++UE4+Release-4.17

level blueprint:

levelBlueprint

Camera 1 rotation:

Camera 2 rotation:

PrintString output (Yellow color is camera 1 rotation, green - camera 2):

Hello,

Thank you for submitting a bug report. I have reproduced this issue and logged a report for it here

You can track the report’s status as the issue is reviewed by our development staff. Please be aware that this issue may not be prioritized or fixed soon.

I think some more clarifications are needed.

issue is not regarding Print String. it is with the camera actor itself returning wrong value in that specific case. Print screen was simplest way to show the issue.

whenever I tried to apply the rotation from camera actor to a dynamicly spawned actor with a mesh, it is rotated with those exact values that Print screen output.

changing one degree to a camera in editor, means those two completely different rotations for spawned actor in play.

Hello,

I was dealing with the exact same issue as you getting these weird rotation returns from the getActorRotation() function. In my case I was interpolating a camera between them using the sequencer which was causing all kinds of strange behavior during interpolation. My hotfix was the same as yours, in that I set my -90 rotation nodes to -89.99 to avoid the issue.

Details here if you’re interested:

Anyway, the fix I was taught to deal with this problem is to use the “bUseQuaternionInterpolation” property when interpolating between transforms. This seems to be specific to the sequencer and the movie scene sections, but you can look at how the engine uses this variable to maybe help with your problem.

For anyone using blueprints to access the tracks and sections of the sequencer, you can edit the property like so:

See the above link for the full view of that chain of blueprint nodes.