Using multiple timelines on one Character

I have looked around (a lot) but have not found a solution for this.
I have one character and want to have two timelines for it.
- one will stomp on a creature with a animation, and two sound effects (two playables)
- the other will perform a victory dance , again with an animation and music.(two playables)

The TimelineController tutorial does not seem to help; one tank has two timelines, but
I cant see how to discriminate. Tags would be good, but you cant tag them.

Unity Technologies

The PlayableDirector does not need to be on the same object as the object being controlled by a timeline. You can have several gameObjects with PlayableDirectors (i.e. timelines) that control the same character.

The PlayableDirector does not need to be on the same object as the object being controlled by a timeline. You can have several gameObjects with PlayableDirectors (i.e. timelines) that control the same character.

Click to expand...

I do understand that, but does that mean I have to create arbitrary (empty?) GameObjects just for each one to have a Playable Director, and then keep track of which playables each controls? or else put PlayableDirectors on abitrary objects? Specifically, how would deal with a third person controller Character with multiple separate playables?

Unity Technologies

Yes, that is one way to do it. Each timeline asset could have it's own gameObject with a playableDirector, and the controller would interact with the player. The advantage is that each timeline could add a bit of an ease in on the first clip to simulate blending. Full arbitrary blending is a bit more difficult.

Alternatively, you could have one playableDirector, and dynamically change the timelines. In this case the binding of the track to animator may need to be scripted (using SetGenericBinding). The playable director binds individual tracks to objects. There is no mechanism for binding by name/tags, but it does remember bindings from previous timelines.

Thanks for the response. Separate gameobjects seems crazy design. I can’t see an obvious design methodology that would embrace that idea. So a Character, for example, would have "objects" attached as children, whose sole responsibility was to run playables? The "realworld" analogue is what? Or am I missing something?

Unity Technologies

It appears like you are trying to use timelines as states in a state machine. That's a use case that many people are trying, and we are working on internally.

Because timelines are assets, the playable director is necessary to store the bindings - i.e. the links from bindings to tracks. It is possible to set the bindings via script. If you wanted to add an additional component that does bindings based on naming conventions, tags, or some other way that makes sense to your use case there should be no restriction from doing that, but unfortunately it's not something that we've provided 'out of the box'

It appears like you are trying to use timelines as states in a state machine. That's a use case that many people are trying, and we are working on internally.

Because timelines are assets, the playable director is necessary to store the bindings - i.e. the links from bindings to tracks. It is possible to set the bindings via script. If you wanted to add an additional component that does bindings based on naming conventions, tags, or some other way that makes sense to your use case there should be no restriction from doing that, but unfortunately it's not something that we've provided 'out of the box'

Click to expand...

Make mecanim accept timelines via drag + drop, with timelines appearing as a state to transition to?

Would really unify the two systems and make a lot of things possible. Especially if can be combined with behaviours like statemachinebehaviour