I am building a portrait 3D mobile app/game. I need certain 3D objects to be placed at the top and bottom of the screen regardless of the screen size.
For example, let’s say I have gate fit set to Horizontal (which is what I want) and then I have a cube at the bottom of the screen like this in a tall screen resolution:

If I change the resolution to a shorter height, I get this, where the box is mostly cut out of view:
To get the object back into view while maintaining the same rough width, I have three options:
- Tilt the camera down.
- Lower the camera in the scene.
- Raise the box in the scene.
These options can create outcomes like the following which are acceptable:


Since I’m working in 3D space, this then becomes a somewhat “artistic” decision for how I accommodate the screen size changes. I think the best way to solve this is to have an array of positions or camera angles for each resolution. I would manually adjust the positions for the range of expected ratios.
Ie. For camera shifting: If ratio is 9x16, camera position in the vertical axis is (position).
If ratio is 3x4, camera position in the vertical axis is (position) minus (shift amount).
However, I don’t know how to do this. This is the first thing I’ve done in Unity. I understand moderate C++. I understand 3D design from Blender. But I don’t know how to integrate code into Unity or how this type of code would be written or where I would punch it in.
Is this a simple task? Is there a simple way to handle it? Can anyone help me learn a bit and teach me how to do this? I would really appreciate it as this is fundamental to what I need to do to get going.
Thanks.