- Home /
Unity iPhone - Camera Orthographic size - Differing results
Hi all,
I'm using Unity iPhone to produce what looks like a 2D APP using sprites attached to 3D Game Objects. I wanted to be able to position my 3D Objects in pixel values. To do this, I first created my background sprite with a width and height of the iPhone screen's dimension, and kept upping the camera's orthographic size until the background displayed perfectly within the bounds of the Unity Editor's Player, which is set to "iPhone Tall". Everything works lovely and moving the sprite 10 units in X appears to nudge it over what looks like 10 pixels!
GREAT!
However, when I compile to iPhone the background sprite fits in Y, but is squashed in X - it doesn't fit perfectly anymore - far from it.
Any ideas as to why just the X value is not working in pixels values anymore? Or, is there an easier way for me to achieve pixel units within Unity? Lastly, why would it look great/perfect in Unity Editor Player, and then be different on the phone?
Thanks guys
Mat
EDIT: In case it makes a difference, the orthographic size is set to '240' for portrait mode, in order for the world units to shift things in pixel values.
Answer by Mat Brummitt · Jun 27, 2010 at 11:11 PM
The answer lies with: Camera.ResetAspect();
I don't believe I was ever setting the camera's aspect, only orthographicSize... Nevertheless this solved my issue, and i'm so please I don't have this problem any more!
Thanks
Mat
Your answer
Follow this Question
Related Questions
A node in a childnode? 1 Answer
How to support Retina display 1 Answer
How do I invert the Y axis in Penelope tutorial? 3 Answers
Compiling in Xcode? 0 Answers
Spawn Script not working on iPhone? 0 Answers