- Home /
Hi, Do we need to code 3d game for every aspect ratio
Hi all, am currently making a 3D Mobile game(in landscape) for android using unity3d. I want to know whether i need to code the camera viewport to scale to all aspect ratio or will Unity take care about that.
Simply drop a 3D model in the scene. Build for Android and bam. You have a 3D object on your phone if you put it on your phone.
Answer by BrinkHouseGames · Aug 08, 2013 at 02:28 AM
Because you are working in a 3D environment, the game world will be presented regardless of aspect ratio or resolution, however things like UI, titles, etc. not be repositioned automatically. These types of elements need to be dynamic and aware of the players aspect ratio and resolution, if you plan to support multiple sizes. Look into using anchors for text and labels as it's a good place to begin learning about the screen bounds and how to position elements at runtime depending on the users configuration. :)
http://docs.unity3d.com/Documentation/ScriptReference/30_search.html?q=anchor
And to specifically answer your question, no, you don't need to write code for the camera in order for Unity to adjust to the end device, you just may not see everything or have your GUI positioned as intended. For example if you are viewing a 16:9 viewport inside Unity, and then publish to a 4:3 device, you will still see the environment fill your screen, but the left and right sides will be lost, including any buttons or GUI you may have had. Same goes for all other ratios as well.