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

Android: glitchy bars rendered outside of camera instead of black bars

Discussion in 'Editor & General Support' started by Bluzeere, Jan 5, 2020.

  1. Bluzeere

    Bluzeere

    Joined:
    Mar 15, 2017
    Posts:
    7
    When testing to S9, the camera is resized to fit height (turned 90 degrees) and keep aspect ratio, so there are bars outside of the camera on the left and right.

    But instead of displaying black bars, the app is buggy and displays parts of the rest of the camera in an unfathomable pattern.

    See attached screenshot for example.

    More info for troubleshooting purposes:

    The glitch displays elements from both the camera and UI.

    In one scene, the UI is fitted to the camera and doesn't go outside it; in another scene, the UI isn't fitted to camera and is fitted to screen, displaying outside the camera. I need to fix that, but in the meantime I believe this shows that the problem isn't due to empty areas between UI and camera since on one scene they are the same size and I still get the issue.

    I tried putting a black bar across the UI that stretches far away to the left and right. It covers the area to the right of the camera, but not to the left, if that indicates anything. Shown on the attached screenshot in the top area


    Thanks for any help.
     

    Attached Files:

    • bug.jpg
      bug.jpg
      File size:
      392.9 KB
      Views:
      332
  2. Bluzeere

    Bluzeere

    Joined:
    Mar 15, 2017
    Posts:
    7
    Problem solved.

    It was caused by camera's Viewport Rect X, Y, W, H not being 0, 0, 1, 1.
    I had an old code to resize camera in-game change it, which confused me as in the editor it was correctly 0, 0, 1, 1 but changed in-game.