Search Unity

  1. Get all the Unite Berlin 2018 news on the blog.
    Dismiss Notice
  2. Unity 2018.2 has arrived! Read about it here.
    Dismiss Notice
  3. We're looking for your feedback on the platforms you use and how you use them. Let us know!
    Dismiss Notice
  4. The Unity Pro & Visual Studio Professional Bundle gives you the tools you need to develop faster & collaborate more efficiently. Learn more.
    Dismiss Notice
  5. Improve your Unity skills with a certified instructor in a private, interactive classroom. Learn more.
    Dismiss Notice
  6. ARCore is out of developer preview! Read about it here.
    Dismiss Notice
  7. Magic Leap’s Lumin SDK Technical Preview for Unity lets you get started creating content for Magic Leap One™. Find more information on our blog!
    Dismiss Notice
  8. Want to see the most recent patch releases? Take a peek at the patch release page.
    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:
    3
    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:
    479
    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:
    3
    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:
    479
    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:
    3
    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?
     
  6. seant_unity

    seant_unity

    Unity Technologies

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

    GameDevCouple_I

    Joined:
    Oct 5, 2013
    Posts:
    856
    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:
    479