Get device actual x,y,z angles in the real world

Hi,
i’m trying to get the mobile device direction in the world (where the “camera” or back of it is looking)

is there a way to get the actual x,y,z angles (0-360) from the device?
it seems that gyro, acceleration, and heading are not enough by themselves.
even some virtual sensor that will combine them i guess can help here somehow

i will be happy for some guidance
thanks a lot!

You mean gyroscope - events?

Here is how it works:

event.xRotation
event.yRotation
event.zRotation

gyroscope will give you the CHANGE in position with deltatime, i want absolute position without tracking it myself, (also i will not know what is the start position)

Hmm understand, what you can check - create a layer “hold you mobile-device horizontal and press a button” - Then you can save the start position. After that calculate the changes with the help of the start-position. Maybe it works.