Search Unity

  1. Unity 2019.2 is now released.
    Dismiss Notice

Cinemachine randomly changes view by 180 degrees

Discussion in 'Cinemachine' started by Oktopod, Jul 7, 2019.

  1. Oktopod

    Oktopod

    Joined:
    Mar 10, 2018
    Posts:
    4
    Hello everyone, first time poster since almost all issues that I have had in the past were easily resolved with a quick google or forum search.
    I have recently switched to Cinemachine as oppose to just making the camera a child of the player. Everything was working fine, unitl recently, without any settings changes that I can just undo, the camera just randomly switches to looking at the player from the opposite position. Sometimes it stays like that, sometimes it lasts for 0.1 seconds. I have only one virtual camera in the scene, so this is not related to blending or transitioning from one camera to another. The same camera just flips. Does anyone know what I can do. I will post screenshots of this random flip to provide more context. The biggest problem is that this happens 100% randomly. It is not consistent. Sometimes it never happens, sometimes it happens once in the level, sometimes multiple times, very rarely in the same spot in the level. I have googled for hours with no results.
    Thank you in advance!
     

    Attached Files:

    Last edited: Jul 7, 2019
  2. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    3,063
    Can you show an image of the inspector for the vcam?
     
  3. Oktopod

    Oktopod

    Joined:
    Mar 10, 2018
    Posts:
    4
    Of course. Can't believe I forgot that
     

    Attached Files:

  4. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    3,063
    Hmmm... it all looks pretty normal.
    Does the flip happen in a single frame, or does the camera damp its way around?
    Can you show an image of the CM Brain inspector too?
    Are you doing anything weird with the target's rotation? Or the world up override?
     
  5. Oktopod

    Oktopod

    Joined:
    Mar 10, 2018
    Posts:
    4
    I will post the player settings also just in case, along with this link: https://imgur.com/a/5pvZ2Ck where you can see the recorded footage of this issue. I was lucky to capture it happening both for 0.1 seconds as I described, AND changing and staying that way. Hope it provides some insight. As for the target's rotation, not that I know of
     

    Attached Files:

  6. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    3,063
    aahh! You are doing something with the player rotation: it's turning upside-down, which makes its forward face backwards. Since you're binding to target's local rotation, your offset flips around relative to the world, but stays constant relative to the target. Try changing the binding mode to World Space.
     
    Last edited: Jul 8, 2019
  7. Oktopod

    Oktopod

    Joined:
    Mar 10, 2018
    Posts:
    4
    You are a god. That fixed it! Thank you soo much! I've played through the level multiple times trying to find the spots where it flips most often but the issue didn't show up, not even once!
     
    Gregoryl likes this.