Search Unity

Bug Cinemachine + URP PixelPerfectCamera + CinemachineConfiner2D having strange issues

Discussion in 'Cinemachine' started by LelouBil, Jul 17, 2021.

  1. LelouBil

    LelouBil

    Joined:
    Jun 24, 2017
    Posts:
    5
    Hello, In my project I am using Cinemachine 2.8.0-pre1 and URP 10.2.2 and I am having problems with the CinemachineConfiner2D Only on specific scenes.

    On some scenes of my game, and only in the Player not in the editor, the confiner is just not working.

    If I change the Ortho size of my cinemachine VirtualCamera to a smaller value manually it works, however the pixel perfectcamera should already be doing this (and it does on every other scene in my game).

    I have not been able to reproduce this in a simple project so please tell me what information do you need to help.
     
  2. gaborkb

    gaborkb

    Unity Technologies

    Joined:
    Nov 7, 2019
    Posts:
    856
    Could you show your Camera Follow script?

    When you build, what's your screen resolution, test the same resolution in the editor. You may need to turn on the oversize window property.
     
  3. LelouBil

    LelouBil

    Joined:
    Jun 24, 2017
    Posts:
    5
    I actually just got it fixed, thanks for replying.

    It was just a resolution problem actually.
    The inspector window was not in the same aspect ratio.

    My camera follow script is just building the collider and giving it to the Confiner2D

    I thought just by checking Upscale render texture in the PixelPerfectCamera settings that the camera size would not get bigger depending on the aspect ratio but that wasn't the case.

    I now use Crop frame X & Y and Stretch fill and have a script to set the reference resolution for some known supported aspect ratios.
     
    gaborkb and Gregoryl like this.