Search Unity

CinemachineCollider bug. When camera detects double collider it jumps forward to bad position.

Discussion in 'Cinemachine' started by RedRival, Jan 12, 2019.

  1. RedRival

    RedRival

    Joined:
    Nov 23, 2012
    Posts:
    4
    After digging around why my camera jumps before player and trying different things I finally found a cause of this noughty bug.
    I use CinemachineCollider for CinemachineFreeLook for simple 3d person camera and when player steps back to a wall sometime camera jumps before him with strange pattern. After some research I noticed that double colliders are the root of the problem.
    Here is settings just for the info, but really it doesn't matter, buggy behaviour exists in every mode.
    upload_2019-1-12_16-9-48.png

    With simple setup our camera behaves correctly as expected:
    upload_2019-1-12_16-12-9.png

    But the moment we duplicate that wall behind, camera jumps into the wrong position before the player:
    upload_2019-1-12_16-13-47.png

    It seems when raycast hits more than once it pushes camera for every hit somehow. The interesting thing is that after 1-2 seconds it may move back to correct position. If we continue to duplicate walls it pushes the camera even more.
     
    Last edited: Jan 12, 2019
  2. slavaglap

    slavaglap

    Joined:
    Sep 22, 2017
    Posts:
    7
    I have the same problem
     
  3. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    2,603
    This is a bug in CinemachineCollider, when resolving the camera radius. If you set the Collider's camera radius to 0, the problem goes away. We're working on a fix, should be there in the next release of CM (2.2.9).
     
  4. RedRival

    RedRival

    Joined:
    Nov 23, 2012
    Posts:
    4
    Thank you!