there are several posts about the unexpected behavior of
but to me it’s still unclear how to set the local rotation of an entity in regular degrees and returning the same values when using
Could anyone clarify this for me please?
Euler angles are not stored in the entity directly but instead applied to the transformation matrix.
GetEulerAngles actually calculates the X Y Z angles from the matrix. However, since a rotation can be represented in a number of different X Y Z Euler angles rotations, what was set earlier may not be the same as what you get out again.
If you need to work in Euler angles, it is recommended that you keep track of them yourself in a script.
Check how this example does it, to rotate the camera using the mouse:
Thank you @yaustar and @Leonidas.
Now it makes sense to me
I will check out the example project.