Hi.
I have created this script, which controls the walking, sprinting and idle animations that are attached to my weapon.
static var walking : boolean=false;
static var sprinting : boolean=false;
function Update () {
if(walking==true){
animation.CrossFade("walk");
}
if(sprinting==true){
animation.CrossFade("sprint",0.2);
}
if(walking==false && sprinting==false){
animation.CrossFade("idle");
}
}
Another script controls the walking and sprinting booleans. When the sprinting animation is CrossFaded it plays about half of the animation clip, then glitches between the sprinting and walking poses.
Youtube Video Of The Problem…