Search Unity

Bug Blend Issue with timeline from cutscene camera to gameplay camera

Discussion in 'Cinemachine' started by Mars91, Jul 14, 2022.

  1. Mars91

    Mars91

    Joined:
    Mar 6, 2012
    Posts:
    572
  2. Mars91

    Mars91

    Joined:
    Mar 6, 2012
    Posts:
    572
    UPDATE:
    If I toggle off Inherit Position everything works and the camera cut with no issue. the problem is that I NEED Inherit Position o_O
     
  3. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,730
    Yes, the "blend" is caused in this case by InheritPosition.

    If you're able to turn off InheritPosition when the cutscene starts, then you can write an event handler to turn it back on immediately after the cutscene cuts to it.

    Make a little script like this
    Code (CSharp):
    1. using UnityEngine;
    2. using Cinemachine;
    3.  
    4. public class AutoEnableInheritPosition : MonoBehaviour
    5. {
    6.     public void EnableInheritPosition() => GetComponent<CinemachineVirtualCamera>().m_Transitions.m_InheritPosition = true;
    7. }
    8.  
    then add it to your vcam, and set up your vcam's OnCameraLive to call it:

    upload_2022-7-14_15-6-38.png

    It will get called just after InheritPosition would have been applied, had it been set. InheritPosition will stay on until you turn it off for the next cutscene.
     
    Yuchen_Chang likes this.
  4. Mars91

    Mars91

    Joined:
    Mar 6, 2012
    Posts:
    572
    That's pretty cool, already thought about that but thought there could be a more elegant solution. So I will just disable InheritPos on cutscene start and everytime the cam is live again inherit pos is enabled again.
     
  5. Mars91

    Mars91

    Joined:
    Mar 6, 2012
    Posts:
    572
    I also have another question about loading levels, cinemachine track and camera reference. Should I post it in another thread?
     
  6. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,730
    ideally, yes