Search Unity

Animation Additive not working

Discussion in 'Animation' started by pokybluesky, Jul 19, 2014.

  1. pokybluesky

    pokybluesky

    Joined:
    Feb 19, 2014
    Posts:
    3
    What can cause animation additive not working ?

    I have 3 files - idle, walk and shoot that I exported them from blender.

    I did layer them and still not work. it's not add the shoot animation to either idle or walk. Please help

    Code (JavaScript):
    1.  
    2.  
    3. function Start () {
    4.  
    5.  
    6.  
    7.     ani[animationidle.name].layer = 2;
    8.  
    9.     ani[animationidle.name].enabled = true;
    10.  
    11.  
    12.  
    13.     ani[animationwalk.name].layer = 2;
    14.  
    15.     ani[animationwalk.name].enabled = true;
    16.  
    17.  
    18.  
    19.     ani[animationshoot.name].layer = 4;
    20.  
    21.     ani[animationshoot.name].weight = 1;
    22.  
    23.     ani[animationshoot.name].blendMode = AnimationBlendMode.Additive;
    24.  
    25.     ani[animationshoot.name].enabled = true;
    26.  
    27.  
    28.  
    29. }
    30.  
    31.  
    32.  
    33. function Update () {
    34.  
    35.  
    36.  
    37.  
    38.  
    39.         if (leftJoystick.IsFingerDown())
    40.  
    41.             ani.Play(animationwalk.name);
    42.  
    43.         else
    44.  
    45.             ani.Play(animationidle.name);
    46.  
    47.          
    48.  
    49.         if (rightJoystick.IsFingerDown()) {
    50.  
    51.             ani[animationshoot.name].enabled = true;
    52.  
    53.         }
    54.  
    55.         else
    56.  
    57.             ani[animationshoot.name].enabled = false;
    58.  
    59.  
    60.  
    61. }
    62.  
    63.  
    64.  
     
    Last edited: Jul 19, 2014