Search Unity

I have a question about the usage of "Timeline"

Discussion in 'Timeline' started by cdytoby, Jul 24, 2017.

  1. cdytoby

    cdytoby

    Joined:
    Nov 19, 2014
    Posts:
    181
    I never used Playables and Timelines in previous version. And I just tried the feature. I have a question about the functionality:

    Is this "Playable" designed to "help create an Animator" or it's a replacement for "Animator"? All the tutorials showed that this feature is similar to Animator.

    And, If I want to achieve level design like "at 2 second point show this enemy" and "at 10 second point show a bird fly through sky" these stuff, should I use "Playable" system or just write my own code in Update?

    One more thing: can I generate a "Timeline" at runtime? For example I get a json from internet, and I create/generate my own timeline according to my json string, during runtime.
     
  2. seant_unity

    seant_unity

    Unity Technologies

    Joined:
    Aug 25, 2015
    Posts:
    1,516
    Playables are what are used to create an animation state machine under the hood. So it's not a replacement for Animator, but more like an API to build your own blend trees. The animator is what plays them. Timeline uses animation playables to build a (sub) graph and uses the animator to play it.

    Either Update or Playables will work, it very much depends on what else you are trying to do. For the example you mention, Update sounds like should work just fine. Timeline may work as well, if everything is meant to be synchronized.

    And yes, there is an API to create Timelines at runtime, so you could read a JSON and create and play a timeline.