Search Unity

Timeline + cinemachine reset sequence problems

Discussion in 'Timeline' started by Misscelan, Jul 12, 2019.

  1. Misscelan

    Misscelan

    Joined:
    Mar 8, 2013
    Posts:
    99
    I have this sequence with a Cinemachine Shot Ease In, the first time is played there are no issues, but if I want to replay the same sequence the VCamera starts the Ease In from the position it got in the last frame of the sequence instead of the current Gameplay Camera position.

    I used this to reset the sequence

    Code (CSharp):
    1. p_player_dir.time = 0;
    2. p_player_dir.Stop();
    3. p_player_dir.Evaluate();
    Also, activating and deactivating the component and the gameobject holding the playable director but still behaves the same way.

    This is a picture of the sequence, note there is a frame set position for the camera on the first frame:


    I'm using the latest version of Unity and Cinemachine.
     
  2. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    2,611
    Some issues I notice in your image:
    • Why do you have an activation track for CM vcam11?
    • There is no binding on the CM track.
    • What do you mean by a frame set position? Are you animating the vcam's transform? That won't work if the vcam tries to procedurally animate its own transform. Can you show an image of the vcam inspector?
     
    Last edited: Jul 12, 2019
    dursteric likes this.
  3. Misscelan

    Misscelan

    Joined:
    Mar 8, 2013
    Posts:
    99
    Hi Gregoryl,

    Thanks for the response.
    Not sure if in the latest update it works ok, but I had some issues in previous versions when more than one vcam was active, they would behave erratically overlapping randomly each other, so since then I activate and deactivate the vcams whenever I want them on and off.

    In any case, removing this track doesn't change the behaviour of this specific sequence.

    This is a picture from the editor, the Cinemachine Brain is in another scene and gets binded in real time.

    Code (CSharp):
    1.         CinemachineBrain l_brain = COMMON_Camera.m_instance.GetComponent<CinemachineBrain>();
    2.         l_brain.enabled = true;
    3.         TimelineAsset l_timelineAsset = (TimelineAsset)p_player_dir.playableAsset;
    4.         TrackAsset l_track = (TrackAsset)l_timelineAsset.GetOutputTrack(II_GEL.m_time_line_ouput_track);
    5.         p_player_dir.SetGenericBinding(l_track, l_brain);
    6.                
    Btw, I always put the Cinemachine Track as the first one, and I was always using GetOutputTrack(0) to retrieve the CM track, but on some versions of Timeline+cinemachine this would stop working and was only able to get the Cinematic track using GetOutputTrack(1), so now I'm storing this in a variable and updating accordingly if this does not work on a new update.

    Sorry, by frame set position I meant there was a keyframe set at the beginning of the sequence (trying to make sure the camera would move to that position when the movie would reset).

    And yes, I'm animating the vcam's transform. I don't have the follow or lookat fields set nor any transitions. Here it is a picture.

     
    Last edited: Jul 15, 2019 at 9:54 AM
  4. Misscelan

    Misscelan

    Joined:
    Mar 8, 2013
    Posts:
    99
    Still stuck with this issue, any help would be appreciated
     
  5. seant_unity

    seant_unity

    Unity Technologies

    Joined:
    Aug 25, 2015
    Posts:
    883
    Does the behaviour change if you wait a frame after stopping? Cinemachine isn't given a chance to update without Timeline playing in this scenario.
     
  6. Misscelan

    Misscelan

    Joined:
    Mar 8, 2013
    Posts:
    99
    Thanks for jumping in @seant_unity unfortunately the behaviour is the same if I wait one frame.
    I noticed however the sequence resets properly if I remove the "Ease in" time at the beginning, so it seems the position of the vcam does not get reseted properly or keyframes evaluated during the Ease in.