Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 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 /
avatar image
0
Question by amit-chai · Jul 01, 2012 at 10:14 PM · screenflipwidth

Flipped resolution ?!

Hi, Recently i upgraded to unity 3.5 and xCode 4.2 snow leopard(still). When i use the Screen.width and Screen.height in unity the result are flipped when running on ipad or iphone. I set the app to run landscape Right. the print(Screen.width) is flipped means i get 320 in unity and 480 while running. Any solution for this?? TY:)

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

3 Replies

· Add your reply
  • Sort: 
avatar image
1
Best Answer

Answer by whydoidoit · Jul 01, 2012 at 10:16 PM

Yeah there is a known fault and some potential workarounds in the linked thread.

Comment
Add comment · Show 4 · 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 amit-chai · Jul 01, 2012 at 11:14 PM 0
Share

TY very much :)) im reading it right now

avatar image amit-chai · Jul 01, 2012 at 11:15 PM 0
Share

Hi, ive got this code from googling - where should i put it? it it c##? or javascript? i get errors either way so i dont know how to use it. Please help.

IEnumerator Start ()

 {

     // HAC$$anonymous$$ to prevent game starting in portrait due to Unity bug 

     switch (Input.deviceOrientation) {

     case DeviceOrientation.FaceDown:

     case DeviceOrientation.FaceUp:

     case DeviceOrientation.Portrait:

     case DeviceOrientation.PortraitUpsideDown:

         // None landscape orientation, set it manually

         Screen.orientation = ScreenOrientation.LandscapeLeft;

         // Wait a bit

         yield return new WaitForSeconds(0.5f);

         // Set back to autorotation, it should be alright by now

         Screen.orientation = ScreenOrientation.AutoRotation;

         break;

     }

     yield return null;

 }
avatar image whydoidoit · Jul 02, 2012 at 08:19 AM 0
Share

Well that is C# - put it in a .cs script and attach it to something that is in the first scene.

avatar image amit-chai · Jul 02, 2012 at 07:16 PM 0
Share

Ty very much for all help! i maybe solve this soon, the good news is that i found and manage to use this code here - which i applied and successfully made it work. The app is loading with the right orientation, BUT now the weird thing is that this is sometime work and sometimes not! still working on it....

link text

avatar image
0

Answer by amit-chai · Jul 02, 2012 at 07:15 PM

Ty very much for all help! i maybe solve this soon, the good news is that i found and manage to use this code here - which i applied and successfully made it work. The app is loading with the right orientation, BUT now the weird thing is that this is sometime work and sometimes not! still working on it....

link text

Comment
Add comment · 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
0

Answer by amit-chai · Jul 02, 2012 at 09:32 PM

pweeks
TYYYYY : solution works Location Nederland, CO Posts 75 Posted: 07:58 PM 05-24-2012 Originally Posted by Alexey
http://files.unity3d.com/alexey/AppController.mm it is drop-in replacement for 3.5.2 appcontroller

replacement appcontroller.mm did not work

Comment
Add comment · 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

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

5 People are following this question.

avatar image avatar image avatar image avatar image avatar image

Related Questions

Input.acceleration with Screen.width 1 Answer

Object resolution 0 Answers

behavior of Screen object differs in Unity 3 1 Answer

Screen.width and Screen.currentResolution returning unwanted value 0 Answers

GameObject width in screen space 1 Answer


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