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.

Any ideas would be gratefully received. Even abuse will be tolerated.

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.

[quote=“seant_unity”, post:2, topic: 693960]
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.
[/quote]

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?

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?

1 Like

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'

2 Likes

[quote=“seant_unity”, post:6, topic: 693960]
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’
[/quote]
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

3 Likes

Agreed! :)

3 Likes

[quote=“seant_unity”, post:8, topic: 693960]
Agreed! :slight_smile:
[/quote]
I agree with telgo that it’s bad practice to have 10 players simply because there are 10 timelines to play.
I spent some time adding functionality for storing refs to all the playable data in the scene on our last game but some better solution could have been provided.

Adding a PlayableContainer component that holds timeline asset and the bindings without having all the functions for playing it would seem like the obvious solution so it’ strange it ended up as it did.

[quote=“seant_unity”, post:8, topic: 693960]
Agreed! :slight_smile:
[/quote]
Any upcoming news on integrating timelines in mecanim animator controllers :slight_smile: ?
That would indeed be a tremendous feature.

1 Like

Agreed that it would be, but there is no news on that front yet. 2018.3 changes to animation track offsets are a good step towards it though....

[quote=“seant_unity”, post:11, topic: 693960]
Agreed that it would be, but there is no news on that front yet. 2018.3 changes to animation track offsets are a good step towards it though…
[/quote]
Okay thanks for the update!

Slowly but surely timeline is heading to where we wanted it to be originally, and you can tell because its getting used more and more with each update!

We have begun finally using it at work in the studio, and while I wouldnt call timeline completely production ready in every case (still weird issues here and there with offsets etc that show the system works but the UX is not great) its still very usable in its current state.

Personally the only thing I am waiting for is a visual timeline to timeline blend tool such as described in here about mixing with mecanim.

But ultimately @seant_unity as long as we can go from one timeline to another, without duplication of lots of stuff, in a fast efficient UX for this editing, it does not matter if it works with mecanim or not! :slight_smile:

If I wanted that functionality I would write a state behaviour to do the job. Wouldn't that cover it?

What would be nice though is a way to blend out a all tracks runtime
.

[quote=“JimmyGrue”, post:13, topic: 693960]
If I wanted that functionality I would write a state behaviour to do the job. Wouldn’t that cover it?

What would be nice though is a way to blend out a all tracks runtime
.
[/quote]
Probably a feasible workaround.

[quote=“MadeFromPolygons_1”, post:7, topic: 693960]
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
[/quote]
Agree!!!:roll_eyes:

1 Like

Any updates on combining Mecanim with Timeline? 2021 is approaching fast, folks!

Nothing major expected for 2021, although there are a few bug fixes (landed in 2020.2) with blending between timelines and animator controller. Hopefully, we can improve it further in 2021 but unfortunately I don't have specific details.

Thanks for getting back to us @seant_unity :)

[quote=“seant_unity”, post:17, topic: 693960]
Hopefully, we can improve it further in 2021
[/quote]
Any updates on combining Mecanim with Timeline?

[quote=“seant_unity”, post:17, topic: 693960]
Hopefully, we can improve it further in 2021 but unfortunately I don’t have specific details.
[/quote]

I’m also excited about this idea! Any news?