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. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

Question Screen.resolutions in Macbook Air M1

Discussion in 'macOS' started by diegoadrada, Dec 22, 2022.

  1. diegoadrada

    diegoadrada

    Joined:
    Nov 27, 2014
    Posts:
    59
    I am running tests on a Macbook Air M1, and when I use the Screen.resolutions function, it only displays 1440x900 instead of the native resolution of 2560x1600 and the other supported scaled resolutions. However, this function works perfectly in Windows. Does anyone have any ideas about how to address this issue? Thank you in advance for any suggestions!
     
  2. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    11,026
    Screen resolutions is an array and it returns all valid resolutions for your monitor. I'm guessing you're just checking the first returned value?

    https://docs.unity3d.com/ScriptReference/Screen-resolutions.html

    What do you want to do exactly? It is possible Screen resolutions isn't appropriate for what you want to do.
     
  3. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    11,026
    This is what the full array returns for me on my M1 Macbook Pro

    upload_2022-12-22_5-33-37.png
     
  4. diegoadrada

    diegoadrada

    Joined:
    Nov 27, 2014
    Posts:
    59
    My bad, I forgot to mention that I'm using a bucle for reading all the values of the Screen.resolutions array. i.e, in Windows with a Full HD Asus Monitor, it shows me 1280x720, 1360x768, 1366x768, 1600x900 and 1920x1080, the problem is with the Mac I mentioned aboved, it only shows 1440x900 @ 0hz

    I'm developing a pixel art game with pixel perfect, so I need to determine which are the supported resolutions in order to set the default resolution that fits better with the current monitor, and also to show all the compatible sizes in the settings menu.

    I'm using Unity 2021.3.4f1.
     
  5. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    11,026
    I would try a newer 2021.3. I know they fixed some bugs for Screen resolutions in the last couple of months, not sure if it covers your use-case but it's worth a try.
     
  6. diegoadrada

    diegoadrada

    Joined:
    Nov 27, 2014
    Posts:
    59
    Thanks! But still having the same result with Unity 2021.2.16f1, it's also weird that returns @0hz instead of @60hz.