Search Unity

Cinemachine causing jitter in Game View in Editor

Discussion in 'Cinemachine' started by chainsawpenguin, Sep 6, 2018.

  1. chainsawpenguin

    chainsawpenguin

    Joined:
    Sep 28, 2014
    Posts:
    107
    I often have the game view open in a pane in the Editor so that I can watch both it, and, say, an animator. But with a Cinemachine camera enabled, when NOT in Gameplay mode, the Game panel just freaks the hell out. Why is it moving at all? I'm not touching the camera or its target, I'm just navigating around the editor.

    EDIT: For example, resizing the Game pane causes the camera preview to jerk around by 90 degrees, back and forth. I could just hide Game pane, but then I need to UNhide it when I'm troubleshooting... GAH!
     
    Last edited: Sep 6, 2018
  2. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,726
    Shouldn't happen.. Which version of CM ant what kind of vcam and target?
     
  3. chainsawpenguin

    chainsawpenguin

    Joined:
    Sep 28, 2014
    Posts:
    107
    Cinemachine version [2.2.7] - according to the #Changelog

    The vcam is a Cinemachine Freelook with a Cinemachine Collider.

    The target is an empty Game Object that is a child of my main character, set to roughly the height of his head.
     
  4. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,726
    Does it still happen if you disable the CM collider? Can you post an image of your vcam inspector? And the hierarchy, showing the vcam, the main camera, and the target?
     
  5. chainsawpenguin

    chainsawpenguin

    Joined:
    Sep 28, 2014
    Posts:
    107
    See here:
     

    Attached Files:

  6. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,726
    Is the vcam looking straight down? If so, that might explain it. Vcam composers don't like to look straight up or down. Give that top orbit a little radius.
     
  7. chainsawpenguin

    chainsawpenguin

    Joined:
    Sep 28, 2014
    Posts:
    107
    Does it still happen if you disable the CM collider?

    Yes.

    Can you post an image of your vcam inspector?

    Yes. See below.

    And the hierarchy, showing the vcam, the main camera, and the target?

    I don't know how to show all three of those things at once in a single screenshot. If the image attached is insufficient... I'll work on it.
     

    Attached Files:

  8. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,726
    The vcams should not be parented to the main camera. That might be the cause. Take them out.
     
  9. chainsawpenguin

    chainsawpenguin

    Joined:
    Sep 28, 2014
    Posts:
    107
    They don't have to be parented to the Main Camera with the Cinemachine Brain?

    ...Trippy. Okay, that seems to have worked!
     
  10. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,726
    They must not be parented to the main camera. Think of them as independent agents that, when active, reposition the main camera's transform to be the same as their own. If they are children of the main camera, then they will move when the main camera does, creating a feedback loop, which is what you were seeing.
     
  11. chainsawpenguin

    chainsawpenguin

    Joined:
    Sep 28, 2014
    Posts:
    107
    Very cool explanation, and excellent troubleshooting. Please give this nice sir a raise, Unity!