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 superbsumit · Nov 20, 2013 at 10:25 AM · androidcameraiosresolutionresolution settings

Resolution problem!!!

Hi all,

Lets say I have a 3D Camera showing four cubes as walls, these are the boundaries of my game.

And now I've to show these boundaries on the same position as they are on the editor, for every phone resolution (Android and iOS both).

Please suggest me what should I do to achieve this.

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

2 Replies

· Add your reply
  • Sort: 
avatar image
1

Answer by guykogus · Nov 22, 2013 at 12:08 PM

I used this handy little script:

 public class CameraAnchor : MonoBehaviour
 {
     public Vector2 position;
 
     void Start ()
     {
         Camera cam = Camera.main;
         // Answer thanks to http://answers.unity3d.com/questions/481884/keep-gameobject-on-a-corner-of-the-screen.html
         transform.position = cam.ViewportToWorldPoint(new Vector3(position.x, position.y, -cam.transform.position.z));
     }
 }

Which lets you set an anchor position on the screen. Setting position to (0,0) places it at the bottom-left, while (1,1) is top-right. Hope that helps :)

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 Ben-Stoneman · Nov 20, 2013 at 10:48 AM

This is useful: http://forum.unity3d.com/threads/78154-Supporting-Multiple-iOS-Resolutions-(iPad-iPhone4-3GS)

It would be done by a script that checks the screen width and height of the device it is running on in order to adjust accordingly.

Comment
Add comment · Show 1 · 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 superbsumit · Nov 22, 2013 at 11:45 AM 0
Share

Hi Ben,

First, sorry for replying late, and second, if I go with Screen.width and Screen.height, it could create a real mess for me as there are too many Android resolutions. I've to set it for many resolutions.

Now here is the thing, I have two cameras, 2D and 3D in my scene and I am using NGUI ( 2D Camera ) which helped me in seeing all the 2D UI and which itself helped me manage all the 2D stuff of the game accordingly ( seen same on all devices ). On the other hand 3D Camera shows the 3D UI, so now what I really need is, some stuff or some technique which could manage my 3D stuff in the same manner.

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

19 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

Related Questions

Android hortographic camera cropping 1 Answer

Camera Changes Proportions In Build 1 Answer

Standard Asset joystick has issues when using custom resolution 1 Answer

Camera Recording for Unity 3D 0 Answers

Divide resolution and stretch to screen/window/canvas 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