Search Unity

Playing Timeline on one of Many Possible Instantiated Characters

Discussion in 'Timeline' started by ferretnt, Jun 22, 2018.

  1. ferretnt

    ferretnt

    Joined:
    Apr 10, 2012
    Posts:
    412
    I'm new to timeline, and trying to replace the mess of coroutines that have previously driven our cutscenes.

    Setting up a timeline to play on an asset in the scene seems to work well, and there are many tutorial videos and documentation on this.

    Now, suppose that my scene contains one instantiated character from many possible characters. The characters all have the same hierarchy, skeleton, available anims, etc, in fact they're just different meshes/textures, but we don't know up-front which one will be instantiated into the scene.

    I must be missing the bit where you can write a line of code to tell a PlayableDirector/TimelineAsst/Something to "just play this sequence of animations I've played on this character here" (i.e. replace the gameObject the animator track is bound to with another gameobject.)

    Can anyone explain to me how to do this? A quick google didn't seem to turn up code.
     
  2. ferretnt

    ferretnt

    Joined:
    Apr 10, 2012
    Posts:
    412
    Ah, I see. Use SetGenericBinding.