Is it possible to restrict screen auto-orientation on a single scene?
In my app, I don't want the main (first scene) to auto rotate when the user changes the orientation of their device, but I want them to have device rotation capabilities on other scenes. Is there a way to just turn off the auto orientation just for the main scene?
Answer by david_31 · Dec 15, 2017 at 02:39 PM
You can change screen orientation like this:
Screen.orientation = ScreenOrientation.Landscape; // or Portrait or something another
I'm getting a definition error. Your solution lines up with the Scripting API, but it's not working on my end.
You have named your script ScreenOrientation and it conflicts with UnityEngine's ScreenOrientation (it is enum type), you should change the name of your script.
hello , i have same problem here, but where do i put this script ? in new script or any suggestion? because i can't put script into scene