Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Question Can I do this via c# code?

Discussion in 'Timeline' started by marchall_box, Dec 3, 2020.

  1. marchall_box

    marchall_box

    Joined:
    Mar 28, 2013
    Posts:
    139
    Hello,

    Can I set this variable in runtime via c# code?

    upload_2020-12-3_5-54-44.png

    It seems like I don't have access to it!

    Code (CSharp):
    1.         TimelineAsset timelineAsset = _playableDirector.playableAsset as TimelineAsset;
    2.  
    3.  
    4.         foreach(TrackAsset track in timelineAsset.GetOutputTracks())
    5.         {
    6.             CinemachineTrack cinemachineTrack = track as CinemachineTrack;
    7.             if (cinemachineTrack != null)
    8.             {
    9.                 cinemachineTrack.
    10.             }
    11.         }
    Thank you!
     

    Attached Files:

  2. seant_unity

    seant_unity

    Unity Technologies

    Joined:
    Aug 25, 2015
    Posts:
    1,516
    _playableDirector.SetGenericBinding(cinemachineTrack, sceneCamera);
    where sceneCamera is the cinemachine brain you would like to bind the track to.
     
    marchall_box and oldhighscore like this.