- Home /
Elements missing on Samsung Galaxy S4
Hello, this is going to be a tough one to describe but here goes...
My game was just published to the Google Play store but a few of my friends with high end Android devices like the S4 and HTC One that have resolutions of 1080x1920 are only seeing portions of my game. Specifically this is a portrait only title that has three sets of platforms. The bottom platform is set for y axis -2 and the top one 0.5. The ortho camera is set for 4.79. On other Android devices and the iphone everything is visible but on these two devices the platform at -2 is not visible making the game essentially impossible to play.
I'm really at a loss as to why this is happening, I've set up a game view within Unity with matching resolution and nothing seems to wrong. Just wondering if anyone else has had issues with gameobject layouts at high resolutions.
Answer by supernat · Apr 07, 2014 at 07:05 PM
If the soft menu at the bottom of the phone is present, it reduces your maximum vertical field of view. Hmmm...there are a couple of solutions. One is to make your game disable the soft memu while it is active. The other, probably better way, is to get the max size of the display accounting for the soft menu being present.
Check this link for getting the "visible size": http://stackoverflow.com/questions/3060619/how-to-get-the-visible-size-on-an-activity
I would get the width and usable height of the device, then calculate the aspect ratio, and adjust the field of view based on that aspect ratio. What I mean is reverse calculate the FOV based on the world position -2 and 0.5, so that your camera's frustum covers both positions. Then apply the aspect ratio multiplier to it. That way you support all devices without any specialized code. I haven't done this in Unity but did it in a different game engine, which was all LUA, so I don't think it will help you to see that code. If you're using an orthographic camera, it shouldn't be hard at all. Perspective becomes more difficult, but still it just boils down to simple trig (something like cos(fov) = adjacent/hypot where adjacent is the world position in X to the platform (assuming you are looking forward) and hypot is the Z value to the platform.
If you're lucky, Unity already accounts for the visible size of the actual rendered View (not counting the soft menu) in the Screen.height value. I don't know. If not, you may have to query the Android through the JNIHelper classses.
Your answer
![](https://koobas.hobune.stream/wayback/20220613142156im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Android hortographic camera cropping 1 Answer
Why Is My Orthographic Camera Not Rendering at the Full Resolution? 1 Answer
Fixing the camera's left side in a 2D Game in all screen resolutions 0 Answers
ScreenToWorldPoint not working properly on deployment 0 Answers
Is it possible to keep the player offset in place on the screen independent of resolution? 1 Answer