Auto-rotate screen on android

how can I change the orientation of the screen ?! Yes, a function that determines the tilt values ​​of the device and selects how to put it, but how to perform the installation itself, the rotation of the image on the screen with all the widgets and the resulting ?!

stupid question of a stupid person
Rotate the camera 180 and rotate all widgets similarly

Woah I didn’t know you could do it that way. I thought there was a more engine-level way of doing it. How do you detect when the screen has re-oriented to know that you must rotate the layout?

252951-снимок.jpg

pin x (separated gravity contact) gives values ​​from “-10” to “10”.
Positive values ​​are standard land-scape mode, negative values ​​are when the phone is rotated.
Then it’s easy to separate when there is a turn for the camera and widgets.
Personally, I plan to update the function every half second and write it to the game instance, and then use it either as a spawn or to call the functions to change the orientation in the widgets and charakter, I think this is a good choice.

Cool. thank you