Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

My game doesn't display correctly on different Android phone sizes

Discussion in 'Android' started by kayrayorulmaz, Jan 8, 2021.

  1. kayrayorulmaz

    kayrayorulmaz

    Joined:
    Jul 23, 2020
    Posts:
    3
    So I had noticed that my game's zoom and UI messes up on different Android devices.


    Here's what the game is supposed to look like (running on an emulated google pixel)


    Here's what the game looks like on a friend's Samsung Galaxy:


    Here's what the game looks on an emulated QVGA (ADP2):


    Why is this happening? How can I stop the phones from incorrectly zooming or not rendering the UI at all?

    P.S. I added the images as attached files below if the imgur links don't work:
     

    Attached Files:

    • 1.png
      1.png
      File size:
      66.2 KB
      Views:
      348
    • 2.png
      2.png
      File size:
      34.7 KB
      Views:
      351
    • 3.png
      3.png
      File size:
      42.8 KB
      Views:
      346
  2. VaidasM

    VaidasM

    Unity Technologies

    Joined:
    Jun 27, 2017
    Posts:
    41
    Hey, the offset that you're getting is most likely a result of incorrect UI elements setup (anchor point values, pivot). I can recommend playing around with it in editor, by changing the canvas UI scale mode to "Scale with screen size" and then resizing the Game view in editor to see how the positions change. Also, this documentation might help you to better grasp the UI concepts that are used in the editor:
    https://docs.unity3d.com/2020.2/Documentation/Manual/HOWTO-UIMultiResolution.html
     
  3. kayrayorulmaz

    kayrayorulmaz

    Joined:
    Jul 23, 2020
    Posts:
    3
    Thank you! Readjusting the placement of the UI alongside changing the UI Overlay mode to be based on camera position fixed my problem.