- Home /
auto-rotation in-script
Hi, fellows. I got a problem with auto-rotation. I need my game to have auto-rotation disabled or enabled sometimes(it should be handled by game logic during runtime). I need it to support just landscape orientations. So, it's OK, when I try to disable it (Screen.autorotateToLandscapeRight == false, for instance). Auto-rotation doesn't work (but it still logs to console, that autorotationToLandscapeRight is enabled, it's funny). Then i need to turn on auto-rotation, but Screen.autorotationToLanscapeRight = true doesn't work.
P.S. 1) I always enable\disable both auto-rotations. 2) For instance 'Screen.orientation = ... ' works perfect, but I need my auto-rotation to be animated. Is it possible to implement this feature in-script using Unity built-in functionality.