Dynamically scale my scene/game objects for any mobile device.

Hello,

I am a fairly new Unity developer creating mobile games for Andriod and iPhone. Recently I published my first game on the Andorid store. I’ve received some excellent feedback from my peers and from external sources. One thing that I’ve noticed with developing for Andriod is that i’m having a few scaling issues. I’m currently beginning the first phase of design for a new game that I will be working on, and I want to start it right from the beginning.

1.What are the common best practices for creating your scenes and game objects to allow for a wide variety of resolutions/aspect ratios?

  • Would it be best to pragmatically scale and place your background images and objects on awake? What would be the performance impact of doing it this way?

  • I’ve currently placed code into my project to force it to a 16:9 aspect ratio which handles most devices. Is it best to just force it to scale to the largest aspect ratio out there and then place your game objects within the smallest aspect ratio, so it will work for all?

  • Is there a way to say anchor your objects to the view port? For example anchor your background so that it always scales within the view port. (My understanding is that the viewport changes depending on the devices aspect ratio).

  • Would it be best to create some sort of game manager script for example Scale Manager. You would place your background/game objects as per usual on the scene and then have the scale manager adjust their position/scale accordingly?

2.I’m having a few issues with text scaling on my GUI. I’ve kind of rigged it up so that in my scene view the gui text is HUGE. This apparently seems to work as it falls into place for most devices, but it doesn’t always work and isn’t foolproof. I am an indie developer so if possible i’d like to avoid paying for NGUI, are there any similar products for free on the asset store?

  • I’ve created multiple assets of my text with different font sizes. My GUIText objects on my screen all have their font sizes set to 0 as I was having scaling issues when working with the iPhone. Is this a common issue with GUIText? Is there a better way to manage using custom fonts for your GUI that I seem to not be understanding?

Any tips, resources or suggestions are greatly appreciated. I feel that setting this little bit up correctly before development will save me a lot of time and headaches in the future.

Thanks, Unity noob.

I think I have solution here
My scenes got resolution 1280 x 800 for a good quiality. Then I just multiplicate camera to Matrix4x4. Works pretty fine to me and looks good on every device that I have tested.