Search Unity

Question Camera Stack + Timeline "Cinemachine Track"

Discussion in 'Cinemachine' started by Jamez0r, Jan 21, 2021.

  1. Jamez0r

    Jamez0r

    Joined:
    Jul 29, 2019
    Posts:
    206
    Hi guys, I recently switched from using a single Camera, to using two Cameras. The second Camera is on a Camera Stack, and I need the 'view' of the second Camera to exactly match the first camera.

    To achieve this I added a CinemachineBrain to the second camera also. This works great during normal gameplay.

    The issue I'm running into is that we have lots of cutscenes already set up, and have been using the Cinemachine Track to blend/switch between the two VCAMs we use. Now we need that track to control both Cinemachine Brains.



    An obvious "quick fix" would be to just duplicate the track and apply it to the second Camera's Cinemachine Brain, but that isn't a good long term solution. Imagine scrubbing the timeline, trying to get the timings correct on the VCAM blends/switches, and having to tweak both tracks and make sure that they are exactly the same. :eek:

    Could I possibly set up a script on my second Camera that just mimics whatever values on the first Camera it needs to, in order to keep the camera's views matched up? (I'm not sure exactly what it would be, maybe the "Live Camera" and the "Live Blend" ?)

    Thanks a lot for any help!!!
     
  2. marc_tanenbaum

    marc_tanenbaum

    Unity Technologies

    Joined:
    Oct 22, 2014
    Posts:
    637
    Hi James,

    Maybe a silly question, but given the setup couldn't you just make one camera a child of the other?
     
    Gregoryl likes this.
  3. Jamez0r

    Jamez0r

    Joined:
    Jul 29, 2019
    Posts:
    206
    I change the FOV (to zoom in/out) on the VCAM. The VCAM applies it to the Camera, so if the second Camera was just a child of the first Camera the FOV wouldn't get updated.

    If thats the only thing I'd need to manually apply to the second Camera (aka just set the FOV on both the VCAM and directly on the second Camera) then maybe I could do that? I'm not sure if there are other things the VCAMs do that I'm not remembering.

    I was worried about screenshake also not getting applied, but if screenshake is just altering the transform of the camera than that would also get inherited.
     
  4. marc_tanenbaum

    marc_tanenbaum

    Unity Technologies

    Joined:
    Oct 22, 2014
    Posts:
    637
    It's worth trying. From your explanation, I don't think there's anything you're doing that wouldn't be solved by childing + matching FOV.
     
    Last edited: Jan 21, 2021
    Gregoryl likes this.
  5. Jamez0r

    Jamez0r

    Joined:
    Jul 29, 2019
    Posts:
    206
    Thanks again, this does look to be working!
     
    Gregoryl and marc_tanenbaum like this.