Search Unity

AddClip's bug

Discussion in 'Animation' started by alexhy, Nov 21, 2013.

  1. alexhy

    alexhy

    Joined:
    Nov 21, 2013
    Posts:
    26
    code:
    //original clip
    AnimationClip clip = role.animation["BattleAtk"].clip;

    //create two new clip
    role.animation.AddClip(clip, "newClip1", 0, 10, false);
    role.animation.AddClip(clip, "newClip2", 20, 30, false);

    //queue play the two clips
    role.animation.PlayQueued("newClip1", QueueMode.PlayNow);
    role.animation.PlayQueued("newClip2", QueueMode.CompleteOthers);

    This have a problem, the newClip2 can't play immediately after newClip1,it wait a moment before newClip2 played。
    The total frame of animation["BattleAtk"] is 50,time length is 1.667s,
    I found the reason is the animation["newClip1"] 's time length is 1.667s,it is wrong! because it only have 11 frame,it is unity's bug?