Search Unity

How To Blend Unity Camera With Cinemachine Virtual Camera.

Discussion in 'Cinemachine' started by Mani_Don04, Apr 15, 2019.

  1. Mani_Don04

    Mani_Don04

    Joined:
    Feb 7, 2016
    Posts:
    1
    I am working on construction game. In which unity main camera follows the vehicle using smooth follow script. i want to show some cinematic when vehicle enter into the building. The problem is cinemachine does not allow the main camera to follow the vehicle as it is overriding the main camera values. I have already used cinemachineExternalCamera Component but when timeline i play time line it does not change its position. Please help how can i fix this issue.
     
  2. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,717
    The best-practice is to never animate the main camera. Work with Virtual Cameras instead.

    In your smooth follow script, replace the main camera with another object: a CM virtual camera with Do Nothing in Aim and Body. Putting Do Nothing there turns off the procedural animation and allows the vcam's transform to be animated by your script. When that vcam is active, the main camera (with the CM brain) will track it exactly.

    When your cinematic starts, enable another vcam from timeline, and that will take control while the timeline is active. When the timeline ends, control will be passed back to your normal vcam. Transitions can be cuts or blends.