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

Bug iPhone SE (2nd Generation) returns 0 for Screen.dpi starting with 2019.4.19f1

Discussion in 'iOS and tvOS' started by apiotuch_unity, Mar 18, 2021.

  1. apiotuch_unity

    apiotuch_unity

    Joined:
    Jun 28, 2019
    Posts:
    138
    We have had several users, all with iPhone SE (2nd generation) running iOS 14.4 report GPS/Location not accurately displaying in our map based game. This issue has only started the last couple days (shortly after iOS 14.4.1 was released). We have not been able to reproduce the issue on other devices as of yet. But we had 3 reports in the last 3 days on different SE devices.

    Update:
    It may be a rendering issue, because all of our GPS related markers disappear from the map. Only on SE 2nd Generation.
     
    Last edited: Mar 19, 2021
  2. Petras-Unity

    Petras-Unity

    Unity Technologies

    Joined:
    Oct 7, 2020
    Posts:
    24
    Hey, it sounds like it could be happening due to users not giving precise location permission for your game. Open Settings app, scroll to the bottom, there should be a list of installed apps. Select your app, select Location and there should be Precise Location switch. Try toggling it off to see if problem mimics your users problem. Asking users to check the setting themselves might solve the mystery as well.
     
  3. apiotuch_unity

    apiotuch_unity

    Joined:
    Jun 28, 2019
    Posts:
    138
    @Petras-Unity We have been able to troubleshoot a little more. We believe it is something to do with rendering. We narrowed down to when we updated from 2019.4.5f1 to 2019.4.21f1. After updating to .21, all our map markers don't appear for iPhone SE 2nd gen.
     
  4. Petras-Unity

    Petras-Unity

    Unity Technologies

    Joined:
    Oct 7, 2020
    Posts:
    24
    Do markers disappear only on iPhone SE 2nd gen or are other devices affected after upgrade as well? It would be helpful if you could make a bug report.
     
  5. apiotuch_unity

    apiotuch_unity

    Joined:
    Jun 28, 2019
    Posts:
    138
    @Petras-Unity I am unsure if other devices are affected. From the devices we have tested, only the iPhone SE 2nd gen experiences the issue. Our map is a quad and the map markers are on a 3D canvas. Both the canvas and quad share the same material, which is using the Unlit/Texture shader. Render Queue is set to Geometry 2000. The markers do not have a material set. We are using URP 7.5.3.
     
    Last edited: Mar 26, 2021
  6. apiotuch_unity

    apiotuch_unity

    Joined:
    Jun 28, 2019
    Posts:
    138
    @Petras-Unity I don't know if I will be able to submit a bug report with a small project. Our app is really big and requires networking and addressables to be uploaded for the app be fully functional. However we do have cloud builds set up...
     
  7. nlacroixAOD

    nlacroixAOD

    Joined:
    Jul 20, 2018
    Posts:
    20
    Devices we've tried so far that work fine: iPhone XR, iPhone XS Max, Pixel 3XL, Nexus 5X, iPad Mini 4, iPhone 7, and iPhone 11 Pro Max. All of these have no issue with these same markers except for the SE.
     
    apiotuch_unity likes this.
  8. apiotuch_unity

    apiotuch_unity

    Joined:
    Jun 28, 2019
    Posts:
    138
    @Petras-Unity We have tested:
    iPhone 7
    iPad A1673
    iPhone XR
    iPhone XS Max
    iPhone SE 2nd Gen.
    Pixel XL 3
    Nexus 5x
    Samsung S9
    Samsung Note 9
     
    Last edited: Mar 29, 2021
  9. nlacroixAOD

    nlacroixAOD

    Joined:
    Jul 20, 2018
    Posts:
    20
    @Petras-Unity Unity 2019.4.18 seems to work fine, haven't been able to try 2019.4.19 but I can confirm it does not work in 2019.4.20.
     
    apiotuch_unity likes this.
  10. apiotuch_unity

    apiotuch_unity

    Joined:
    Jun 28, 2019
    Posts:
    138
    @Petras-Unity we are trying to create a simple project to reproduce the issue but we are currently only able to reproduce it in the main project. We have tried changing 3D Canvas Materials to URP Unlit, setting to Transparent, having separate materials on the quad and the markers, and changing their render queue, but none of those attempts have fixed the issue. We are currently making a cloud build for .19. We tried: 2019.4.5, .6, .8, .10, .12, .14, .16, .18 which all work fine. .20 and .21 all have the broken map markers.
     
    Last edited: Mar 29, 2021
  11. nlacroixAOD

    nlacroixAOD

    Joined:
    Jul 20, 2018
    Posts:
    20
    2019.4.19 appears to be the version that it breaks
     
    apiotuch_unity likes this.
  12. apiotuch_unity

    apiotuch_unity

    Joined:
    Jun 28, 2019
    Posts:
    138
  13. apiotuch_unity

    apiotuch_unity

    Joined:
    Jun 28, 2019
    Posts:
    138
    @Petras-Unity just to be clear, that was the issue. Screen.dpi is returning 0 so our algorithm scaled UI elements to 0 as a result. We have since put in a failsafe to have a minimum default value, but I am wondering why 2019.4.19 changed to throw a 0 for the Screen.dpi value. Will Unity be resolving that issue, or is it always something we will have to check for?
     
  14. Petras-Unity

    Petras-Unity

    Unity Technologies

    Joined:
    Oct 7, 2020
    Posts:
    24
    Hey @apiotuch_unity, sorry for a late response. It seems you figured out the origin of problem yourself! The issue you linked to is most probable culprit. It was fixed in 2019.4.23f1, I suggest trying it with that version or any version above. If it's not working with said function let me know, I'll try to look into it more in-depth.
     
  15. apiotuch_unity

    apiotuch_unity

    Joined:
    Jun 28, 2019
    Posts:
    138
    @Petras-Unity when we tried .23 it gave as a bunch of other unrelated issues so we can't test if that solution worked. I don't know when we will look into resolving the issues we experienced with .23.
     
  16. nlacroixAOD

    nlacroixAOD

    Joined:
    Jul 20, 2018
    Posts:
    20
    For now we've just set some defaults to ensure the markers are at least appearing though they may not size properly in all devices that return 0.