Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Using multiple timelines on one Character

Discussion in 'Timeline' started by telgo, Mar 6, 2018.

  1. telgo

    telgo

    Joined:
    Dec 10, 2015
    Posts:
    9
    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.
     
  2. seant_unity

    seant_unity

    Unity Technologies

    Joined:
    Aug 25, 2015
    Posts:
    1,516
    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.
     
  3. telgo

    telgo

    Joined:
    Dec 10, 2015
    Posts:
    9
    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?
     
  4. seant_unity

    seant_unity

    Unity Technologies

    Joined:
    Aug 25, 2015
    Posts:
    1,516
    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.
     
  5. telgo

    telgo

    Joined:
    Dec 10, 2015
    Posts:
    9
    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?
     
    tonytopper likes this.
  6. seant_unity

    seant_unity

    Unity Technologies

    Joined:
    Aug 25, 2015
    Posts:
    1,516
    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'
     
    MadeFromPolygons and telgo like this.
  7. MadeFromPolygons

    MadeFromPolygons

    Joined:
    Oct 5, 2013
    Posts:
    3,967
    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
     
  8. seant_unity

    seant_unity

    Unity Technologies

    Joined:
    Aug 25, 2015
    Posts:
    1,516
  9. JimmyGrue

    JimmyGrue

    Joined:
    Oct 7, 2016
    Posts:
    2
    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.
     
  10. Whatever560

    Whatever560

    Joined:
    Jan 5, 2016
    Posts:
    505
    Any upcoming news on integrating timelines in mecanim animator controllers :) ?
    That would indeed be a tremendous feature.
     
    MadeFromPolygons likes this.
  11. seant_unity

    seant_unity

    Unity Technologies

    Joined:
    Aug 25, 2015
    Posts:
    1,516
    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....
     
  12. MadeFromPolygons

    MadeFromPolygons

    Joined:
    Oct 5, 2013
    Posts:
    3,967
    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! :)
     
  13. JimmyGrue

    JimmyGrue

    Joined:
    Oct 7, 2016
    Posts:
    2
    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
    .
     
    Last edited: Aug 29, 2018
  14. Whatever560

    Whatever560

    Joined:
    Jan 5, 2016
    Posts:
    505
    Probably a feasible workaround.
     
  15. WizardingStudios

    WizardingStudios

    Joined:
    Mar 4, 2017
    Posts:
    13
    Agree!!!:rolleyes:
     
    MadeFromPolygons likes this.
  16. TheSwanCollective

    TheSwanCollective

    Joined:
    May 6, 2016
    Posts:
    26
    Any updates on combining Mecanim with Timeline? 2021 is approaching fast, folks!
     
  17. seant_unity

    seant_unity

    Unity Technologies

    Joined:
    Aug 25, 2015
    Posts:
    1,516
    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.
     
  18. TheSwanCollective

    TheSwanCollective

    Joined:
    May 6, 2016
    Posts:
    26
  19. Peter77

    Peter77

    QA Jesus

    Joined:
    Jun 12, 2013
    Posts:
    6,589
    Any updates on combining Mecanim with Timeline?
     
  20. ysftulek

    ysftulek

    Joined:
    Aug 14, 2015
    Posts:
    43

    I'm also excited about this idea! Any news?
     
  21. Pourya-MDP

    Pourya-MDP

    Joined:
    May 18, 2017
    Posts:
    145
    hello i know this is what everyone asked but we want you to know how badly developers needs this functionality , so any news about animator mecanim and timeline combination??