Local camera rotation?

Greetings, how can i obtain local camera (attached to character) rotation?

Without knowing anything about where you want to do it or if it’s first person or third person, here is a scenario, for querying in any blueprint. In this case you have first person controller with first person camera component. I also assume you have one player character (index 0). Also MainActor is my own class so you would need to cast it to your own class.

Hi,

Simply go to your character BP, drag the camera component and drop it inside your graph. Then search for ‘GetRelativeRotation’ node from Class > Scene Component section (note that you should uncheck context sensitivity to be able to see it).

Note that this will return relative rotation respect to its parent not the root component (unless the parent is root).

If you want to get this rotation from another blueprint, then follow @metamorphium answer.

Hope this helps.

Regards,

@navid100 Hello!

I believe since 4.17 the relative rotation node in this case will only output 0.0. In testing I have found this breaks my camera rotation logic. Do you know of a new way to get relative camera rotation based on player?

For translations, you can simply subtract a child’s world translation from its parent’s world translation. The result would be the child’s relative translation to it’s parent. But for rotations, you can’t subtract rotators, it hardly makes sense. Since rotations unlike translations have rotation order.

Regards.

Could you possibly update your answer with how you achieve this through blueprints, hopefully a mod can come and accept that as the answer. Since the node you have above is now changed. Thanks!