Hello!
We are currently working on a dialog system which would use Timeline as the main tool for placing cameras, characters, and pre-visualisation.
The idea is that a track will pause the timeline, (or set the speed to 0, in order to “keep updating” the timeline), allowing the player interaction to happen.
However, we would like certain animations to keep going ; Idle, for example, should continue playing.
It is extremely similar to the Creative scripting for timeline blog post, which does the following :
polishedkeybushsqueaker
However, the timeline pauses only when there is no clip in the AnimatorTrack. If it does, the character freezes in place like so :
faintcourageousinvisiblerail
I am still a beginner on scripting for Timeline and Playables.
I feel like The ideal solution would be a way to get the AnimationClip to keep going, ignoring the pause. This would make use of AnimatorTrack’s complex programming which handles scene offsets, default human poses, blending from AnimatorController to AnimatorTrack, etc…
The sensical solution for me seems to be a custom track, but so far, I can’t seem to understand how I am meant to play an animation clip, despite using Unity’s Timeline Playable Wizard.
The not-as-good solution could also be to have a monobehaviour on the character that can recieve animationClips and does the overriding itself ; making it dependant on gameTime instead of the director’s time.
(Green means a playable that has the time set to Time.time, red means a playable that has the Timeline’s time)
However, the character is still frozen, as it seems during the graph’s evaluation, the AnimationOffset and AnimationClip times are being set by Timeline.
Manually Evaluating the graph after setting the times doesn’t change the result, either.
I’m also in the same boat. I tried creating custom animation playable track and it works as intended. But it doesn’t play animation while in editor window, which is not a good thing while working on large time consuming project!
Hi S_Affi,
the characters now have a component that allows to create layers and add animation clip playables. It took a long time to do.
It creates a new playable graph that includes the original AnimatorController as the layer 0, so I can add animations on top of the AnimatorController, blending “away” from it. It proved useful in a lot more cases. (Doors contain their “open” animation, and transfer it to the player when interacted with, for example).
Then, a custom timeline track controls this component.
Note that both the component and the timeline track have a lot of “if(!Application.isPlaying)” to have behaviours that allows them to play in edit mode.
The timeline is paused using the code I posted above.
I wouldn’t mind sharing the code… But it isn’t legally mine, apologies.
the component is basically a worse version of the asset Animancer.
you can create new animation track by code.
it create a PlayableGraph to contral you actor.
i finish the system in 2021 to solve timeline and game logic fit