Search Unity

Cinemachine brains picking up a virtual camera on wrong layer

Discussion in 'Cinemachine' started by TheCelt, Apr 16, 2019.

  1. TheCelt

    TheCelt

    Joined:
    Feb 27, 2013
    Posts:
    742
    Hi

    I have two cinemachine brains and two virtual cameras with matching (but different) layers, but my second cinemachine brain is not linking to the vCam on the same layer - both brains seem to link to the same vCam.. :

    Some screen shots for brain A (this one is not linking correctly):

    upload_2019-4-16_4-54-14.png

    Links to this camera:

    upload_2019-4-16_4-54-43.png

    It should link to this camera:
    upload_2019-4-16_4-56-54.png

    Then the other brain (this one is correct):

    upload_2019-4-16_4-55-39.png

    How can i get the Left Camera to link to the Left VCamera and the right Camera to link to the right VCamera?
     
  2. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,724
    It doesn't matter what layer the camera is on, what matters is its culling mask. You want to make sure it sees the vcams that you have placed on the appropriate layers, and filters out the vcams on the other layers.

    upload_2019-4-16_12-17-3.png
     
  3. TheCelt

    TheCelt

    Joined:
    Feb 27, 2013
    Posts:
    742
    Ah thanks. Though it seems i cannot figure out how to do smooth camera blends from a single main camera to a split screen of my two left and right cameras with different brains. I presume this is not currently supported?
     
  4. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,724
    There's no specific support for it out of the box, but you could probably script something without too much trouble.

    It's not clear what you would want the blend to look like. Is the "main" camera on a third brain, or is it on one of the two left and right cameras? What would the transition look like?

    One thought: if the main camera will morph to, say, the left camera, then you could enable the left vcam (CM will blend from main vcam to left vcam), and at the same time have a script that animates the left viewport from fullscreen to left half, and the right viewport from nothing to its final size and position, with the right vcam already in place.
     
  5. TheCelt

    TheCelt

    Joined:
    Feb 27, 2013
    Posts:
    742
    Yeah i'm currently setting it up for main camera to blend to left camera.

    It would be nice if cinemachine could support view port rect blending (also from a perspective to an orthographic projection camera - currently have to do this manually with matrix math that i found online) - then i only have to require an animator on the right camera to bring it's view port into view which simplifies a lot of my setup.