Search Unity

How to add animations to a list

Discussion in 'Scripting' started by HP_tesnn, Oct 21, 2021.

  1. HP_tesnn

    HP_tesnn

    Joined:
    Oct 17, 2020
    Posts:
    30
    Hi everyone. Can anyone show me how to add animation to a list and play all the animations in that list sequentially. If there is any tutorial video, it will be great. Thank you so much for your help.
     
  2. Are you sure you need the list?
    You have this: https://docs.unity3d.com/ScriptReference/Animation.PlayQueued.html
    Also you can do it in the editor, like with Timeline.
     
  3. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    38,745
    Or said another way, nowadays Animations are generally queued as a series of states in the Animator... this lets you fire off a single series of animations end to end, blended even, to end up at a new state.

    You could be walking and press FLY

    - animation: winding up for leaping into he air
    - leaping into the air, arms turn into wings
    - wings are free and flying as you move around (where it loops until you land)
    - folding wings back into arms
    - landing and crouching

    and back to walking.

    The above would all be chained end to end in the Animator with properties to control transitions.