Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Question CinemachineConfiner2D bounds don't match between editor and standalone build

Discussion in 'Cinemachine' started by cloral, Sep 14, 2022.

  1. cloral

    cloral

    Joined:
    Jan 25, 2013
    Posts:
    2
    Hello all, I am running into an issue where the bounds applied by CinemachineConfiner2D don't seem to match between editor and standalone builds.

    I am using Unity version 2021.3.8f1 and Cinemachine version 2.9.1. I am also using 2D Pixel Perfect version 5.0.2.

    Here is a shot of what my setup looks like in the scene. The green rectangle is from the PolygonCollider2D that is assigned to the CinemachineConfiner2D:
    upload_2022-9-14_9-22-31.png

    Here is what the lower-right corner of the area looks like when I run in editor. Note that the camera isn't reaching all the way to the bottom corner of the collider:
    upload_2022-9-14_9-23-45.png

    And here is what I get when I run the standalone build, which runs in fullscreen. Note that the displayed area now matches what the collider is set to.
    upload_2022-9-14_9-25-30.png

    As our designers typically do their testing via the editor, these inconsistent results are causing some issues. Is there something I can change to ensure that the two match up?

    Thanks in advance for any and all responses!
     
    Last edited: Sep 14, 2022
  2. gaborkb

    gaborkb

    Unity Technologies

    Joined:
    Nov 7, 2019
    Posts:
    856
    Could it be that the cameras are different? For example, in the editor your camera has a different aspect ratio from the one in the build?