Search Unity

Bug Cinemachine 2.7.2 confiner extension 2d mode doesn't respect concave confiner.

Discussion in 'Cinemachine' started by Lasiloper, Mar 2, 2021.

  1. Lasiloper

    Lasiloper

    Joined:
    Aug 8, 2017
    Posts:
    10
    Unity Version: 2021.1.0b1.1725
    Windows 10
    Cinemachine: 2.7.2

    Like in image. Camera sink into bounding if the concave edge of bounding shape (yellow) is smaller than camera viewport (white) width. Whereas confiner 2D extension works well with same bounding.

    bug.png
     
    gaborkb likes this.
  2. marc_tanenbaum

    marc_tanenbaum

    Unity Technologies

    Joined:
    Oct 22, 2014
    Posts:
    637
    Thanks for the report. I believe the devs are unavailable today, but I'll ask them to investigate later in the week.
     
  3. gaborkb

    gaborkb

    Unity Technologies

    Joined:
    Nov 7, 2019
    Posts:
    856
    CinemachineConfiner 2D mode is inferior to CinemachineConfiner2D. The problem you encountered is among the reasons why CinemachineConfiner2D component was created. :)

    CinemachineConfiner 2D mode is a simple solution that works in simple cases (e.g. rectangle collider), but does not handle more complex cases well in general, such as concave shapes, undersized (when the camera window does not fit inside the confining area), 2D perspective camera, etc.

    In your case, I would suggest using the new CinemachineConfiner2D component. ;)
     
  4. Lasiloper

    Lasiloper

    Joined:
    Aug 8, 2017
    Posts:
    10
    Thanks for all your replies.

    @marc_tanenbaum But today is vague on this earth. ;)

    @gaborkb I'm confused when I found there are 2 extensions with same functionality but the manual does not mention their difference. I guess you are already planning on merging or removing one of them. I'm using Cinemachine Confiner 2D so there is no problem now.
     
    marc_tanenbaum and gaborkb like this.