Search Unity

Timeline - switch object.

Discussion in 'Timeline' started by SammmZ, Oct 12, 2019.

  1. SammmZ

    SammmZ

    Joined:
    Aug 13, 2014
    Posts:
    174
    Hey! I'm trying to include my character (created at runtime) to timeline action. Is there a way to change the object that have their own animation track on timeline to some other object during runtime? I mean I have a timeline with a dummy animated character, can I swap this dummy to my hero player on runtime?

    Or maybe some other ways to make a cutscene with runtime created object?
     
  2. seant_unity

    seant_unity

    Unity Technologies

    Joined:
    Aug 25, 2015
    Posts:
    1,516
    Yes, the method you are looking for is PlayableDirector.SetGenericBinding(animator, track); The playable director stores the bindings between the tracks and the objects in the scene, this method will let you replace them at runtime.
     
  3. SammmZ

    SammmZ

    Joined:
    Aug 13, 2014
    Posts:
    174
    Perfect! thank you