Search Unity

How to play timeline for 50 warriors in a pack, moving and with animation?

Discussion in 'Timeline' started by paullam328, Jul 21, 2019.

  1. paullam328

    paullam328

    Joined:
    Oct 11, 2017
    Posts:
    6
    Can I stack Playable such that there's 1 playable per pack of warriors, and each warrior has his own playable? Or I need 50 timeline playables? I think there would be a better solution than such for 50 patrolling warriors moving in the same speed and direction... The thing is, I need a playable per warrior for animation in general, since playable for the whole pack doesn't seem to handle animation transitions properly...

    When I tried to stack playables on a pack over each warrior, the playable on the pack doesn't even attempt to record the position update of the pack... 50 playables just sound inefficient...
     
    Last edited: Jul 21, 2019
  2. paullam328

    paullam328

    Joined:
    Oct 11, 2017
    Posts:
    6
    So I can safely assume the functionality of timeline controlling the movement and animations of a group does not exist in Unity, in which I have to implement 50 timelines for 50 independent characters? What if it's 500 warriors moving as a pack? 500 independent timelines? Such inefficiency...
     
  3. GameDevCouple_I

    GameDevCouple_I

    Joined:
    Oct 5, 2013
    Posts:
    1,762
    Its not inefficiency, you just havent read all of the docs.

    Bottom line is: You can do all of that with playables, basically you make your own timeline clip type + track and then you can do whatever you want.

    I cant remember the exact blog post but a lot of it is dealt with here:

    https://blogs.unity3d.com/2018/04/05/creative-scripting-for-timeline/

    So basically you want to make a playable that allows you to slot in a range of your warriors into a list, and then will perform the timeline animation + movement on every warrior in the list on each frame.

    I havent messed with playables in a while so it could be that its doable without a custom playable now, someone else may know more about that.

    Good luck!
     
  4. seant_unity

    seant_unity

    Unity Technologies

    Joined:
    Aug 25, 2015
    Posts:
    919
    Alternately you can create one timeline that plays using an Animation track with Scene Offsets (so that the character placement is where they are placed in the scene), then create 50 playable directors, each with a different binding. i.e. play the same timeline for each character.

    The tradeoff here is
    - there exists only one timeline asset (good!)
    - there exists one gameObject + playableDirector for each character (bad!)
    - there exists one playable graph for each character (neutral - a timeline with 50 tracks would have 50 subgraphs).

    That assumes you want them all in sync, but if you wanted variance you could play with the speed and initial time of each individual playable director.
     
    GameDevCouple_I likes this.