Search Unity

Workarounds for looping an animation while director is Paused?

Discussion in 'Timeline' started by melos_han_tani, May 22, 2020.

  1. melos_han_tani

    melos_han_tani

    Joined:
    Jan 11, 2018
    Posts:
    79
    Hi, I'm using Timeline for linear cutscenes which occasionally pause to display dialogue. After digging around I got that working with various workarounds and the Markers tutorial and was able to hook Timeline up to my existing cutscene/dialogue systems.

    Problem

    There's a limitation I've realized, and it's that when I pause the playback head of the timeline (using the Director hold mode + duration workaround to get 'perfect' pausing), the animations of my models stop playing. This is of course correct behavior, but I was wondering if there's any way to 'remove' timeline's control of the Animator while the timeline is paused and keep the model looping its most recent animation, then smoothly continue on when resuming playback.

    (One workaround I have in mind is not using the animation track and simply use markers to tap into a custom animation system, but that seems like overkill considering it'd be giving up the robust animation timeline features)

    It's not really a dealbreaker if there's not a workaround here, but it would be nice if there was. (Otherwise I guess 3D models freezing during dialogue could probably be used as a stylistic constraint, haha)

    ---

    Slightly related feedback

    Getting at a deeper issue: timeline editors like Timeline are immensely useful for games with scripted sequences - I feel like Timeline is ALMOST "really really good", but after using it for a few hours I feel like it's missing a more intuitive and flexible way of

    - pausing + restarting playback but defining how things like animations respond to stopping playback

    - Letting the user know about how markers can be used to basically do anything (I found it was weird that I had to use this workaround versus the signal tracks which aren't usable because of the need for unique assets for each unique thing i want to do (call a function with a different parameter etc))

    ---

    This is unrelated, but is it possible to change the default animation clip drag-from-edge behavior to loop? Right now I have to shift+click and drag to loop, but I think 99% of the time I will be looping instead of time-stretching an animation clip.
     
  2. seant_unity

    seant_unity

    Unity Technologies

    Joined:
    Aug 25, 2015
    Posts:
    1,516
    One thing to try is to only partly use your workaround.

    Option 1)

    Leave a 'hole' in your animation track, either by easing out the previous clip. or removing extrapolation on it. This will pass control to the animator controller, which can be a state that plays a looping animation.

    Option 2)

    Use a signal to start/stop ,a new timeline with the looping animation. (Yes, this would be a perfect use case for parameters on signal emitters).

    Both of these options rely on animators playing and blending multiple playable graphs (timelines, animator controllers, custom animation playable graphs).

    The animator will play the existing playable controller, then all timelines/playable graphs in the order that they were started.


    Thanks for the constructive feedback. It reinforces some of the issues we are taking into consideration as we move Timeline towards DOTS, which is being developed in alignment with visual scripting so that it can be even better with scripted game sequences.
     
    Sarai and Ofx360 like this.