Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
  • Help Room /
avatar image
0
Question by ashwin12995 · Dec 10, 2015 at 09:09 PM · orientationscene-change

how to set different orientations for each scene?

i have 4 scenes i need to set scene 1 and scene 3 in landscape, scene 2 and scene 4 in portrait mode how can i do this please help me out im searching for a long time but couldnt find out the answer :(

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by Jessespike · Dec 10, 2015 at 09:19 PM

You mean for mobile devices right?

Read this: Unity Scripting - Screen.orientation

 Screen.orientation = ScreenOrientation.LandscapeLeft;
 Screen.orientation = ScreenOrientation.Portrait;
Comment
Add comment · Show 7 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image ashwin12995 · Dec 10, 2015 at 09:24 PM 0
Share

where should i include this script in my scene?

avatar image ashwin12995 · Dec 10, 2015 at 09:31 PM 0
Share

i have many game objects but i dunno in which game object i shld include the script so that it will affect the screen orientation

avatar image Jessespike · Dec 10, 2015 at 09:43 PM 0
Share

Doesn't matter where you put the script. I would put it on the Camera in the scene, cause this affects the screen.

avatar image ashwin12995 · Dec 10, 2015 at 09:47 PM 0
Share

so you say to create an empty script with the code you mentioned above and put the script in the camera right?

so what should be my player settings for screen and resolution?

avatar image ashwin12995 ashwin12995 · Dec 10, 2015 at 09:50 PM 0
Share

using UnityEngine; using System.Collections;

public class Script3 : $$anonymous$$onoBehaviour {

 // Use this for initialization
 void Start () {
 Screen.orientation = ScreenOrientation.Portrait;
 }
 
 // Update is called once per frame
 void Update () {
 
 }

}

is this script sufficient? can this be attached to camera?

and what should i click in the game tab orientation should it be free aspect or anything else?

avatar image zubairhussain404 · May 01, 2020 at 05:40 PM 1
Share

just wondering, what happens if I set default orientation in the player settings. Will this work even then? Say, I have 10 scenes and I want only the first one to be oriented as portrait all others as landscape and I set the default orientation LanscapeLeft and on that particular scene in start function, I wrote Screen.orientation =ScreenOrientation.Portrait;

avatar image unity_QBg3xpqr6LAyjA zubairhussain404 · Aug 06, 2020 at 12:26 AM 0
Share

did it work?

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

34 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

How can I make only one scene landspace? other ones are portrait 0 Answers

Progamatically lock the screen orientation? 1 Answer

Orientation change black screen (android) 0 Answers

How to correctly change scene with a Lobby Manager? 0 Answers

Lifes count resets with level 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges