Search Unity

Two animation for one object ?

Discussion in 'Animation' started by Quast, Feb 8, 2017.

  1. Quast

    Quast

    Joined:
    Jul 5, 2015
    Posts:
    560

    This robot have two animations. one for legs other for the chair. Now I want to run both animations but what I get is one second only of animation !.
    Code (CSharp):
    1.     public Animator vb;
    2.     // Use this for initialization
    3.     void Update () {
    4.         vb.Play("Armature|attack"); // for the chair
    5.         vb.Play("Armature|idle"); // for the legs
    6.     }
    How to solve this ?
     
  2. clarklak11

    clarklak11

    Joined:
    Aug 26, 2016
    Posts:
    22
    Is it required to separate the State? so that you'll just call only one animation
     
  3. TrickyHandz

    TrickyHandz

    Joined:
    Jul 23, 2010
    Posts:
    196
    In order to blend animations the way you want to, you will need to set up another layer and an avatar mask. I would recommend watching at least these two videos regarding the set up:


    Then if you want even more information, there is plenty to see on the Unity Learn page for Animation:
    Unity Learn - Animation