Search Unity

  1. Unity 2019.2 is now released.
    Dismiss Notice

Timeline - switch object.

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

  1. pigglet

    pigglet

    Joined:
    Aug 13, 2014
    Posts:
    62
    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,035
    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. pigglet

    pigglet

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