- Home /
AttackRunning and running animations are not blending
Hello everyone! I'm trying to blend the attackRuning animations with the run animation when the character finishes de attackRuning animations and keeps running.
I achieved to do so with the attack animations and idle animation when the charcter doesn't move.
I'm using the same procedure with both sequence types but its not working on the running ones... Anyone can help me here??
Here's the code, its a little bit large but simple:
function Start() { animation["charge"].wrapMode = WrapMode.Once; animation["charge"].speed = 0.5; animation["attackleft"].wrapMode = WrapMode.Once; animation["attackleft"].speed = 1.5; animation["attackleft"].layer = 1; animation["attackright"].wrapMode = WrapMode.Once; animation["attackright"].layer = 1; animation["attackpleft"].wrapMode = WrapMode.Once; animation["attackpleft"].layer = 1; animation["attackpright"].wrapMode = WrapMode.Once; animation["attackpright"].layer = 1; animation["attackdouble"].wrapMode = WrapMode.Once; animation["attackdouble"].layer = 1; animation["attackdoubleturn"].wrapMode = WrapMode.Once; animation["attackdoubleturn"].layer = 1; animation["attacrunkleft"].wrapMode = WrapMode.Once; animation["attacrunkleft"].speed = 1.5; animation["attacrunkleft"].layer = 1; animation["attackrunright"].wrapMode = WrapMode.Once; animation["attackrunright"].layer = 1; animation["attackrunLleft"].wrapMode = WrapMode.Once; animation["attackrunLleft"].layer = 1; animation["attackrunpright"].wrapMode = WrapMode.Once; animation["attackrunpright"].layer = 1; animation["attackrunturn"].wrapMode = WrapMode.Once; animation["attackrunturn"].layer = 1; animation.Stop(); } function AnimateCharacter() { if (movement.isMoving && !jump.jumping && !charge.charging && movement.speed > 10 && !runattack.runattacking){ animation.CrossFade ("run"); } else if (movement.isMoving && !jump.jumping && !charge.charging && movement.speed <= 10 && !runattack.runattacking) { animation.CrossFade ("walk"); } else if(!movement.isMoving && controller.isGrounded && !charge.charging && !attack.attacking){ runattack.runattackAnim = false; animation.CrossFade ("idle"); } else if (jump.jumping && !charge.charging) { animation.CrossFade ("jump"); } else if (charge.charging && charge.chargeAnim) { animation.Play ("charge"); charge.chargeAnim = false; } else if (attack.attacking && attack.attackAnim && controller.isGrounded && !movement.isMoving) { if (!attack.alque) { animation.CrossFade ("attackleft"); attack.attackAnim = false; attack.alque = true; } else if (!attack.arque) { var attr : AnimationState = animation.CrossFadeQueued ("attackright"); attr.speed = 1.5; attack.attackAnim = false; attack.arque = true; } else if (!attack.aplque) { var attpl : AnimationState = animation.CrossFadeQueued ("attackpleft"); attpl.speed = 1.5; attack.attackAnim = false; attack.aplque = true; } else if (!attack.aprque) { var attpr : AnimationState = animation.CrossFadeQueued ("attackpright"); attpr.speed = 1.5; attack.attackAnim = false; attack.aprque = true; } else if (!attack.adque) { var attd : AnimationState = animation.CrossFadeQueued ("attackdouble"); attd.speed = 1.5; attack.attackAnim = false; attack.adque = true; } else if (!attack.adtque) { var attdt : AnimationState = animation.CrossFadeQueued ("attackdoubleturn"); attdt.speed = 1.5; attack.attackAnim = false; attack.adtque = true; } else { attack.attackAnim = false; } } else if (runattack.runattacking && runattack.runattackAnim && controller.isGrounded && movement.isMoving) { if (!runattack.ralque) { animation.CrossFade ("attackrunleft"); runattack.runattackAnim = false; runattack.ralque = true; } else if (!runattack.rarque) { var rattr : AnimationState = animation.CrossFadeQueued ("attackrunright"); rattr.speed = 1.5; runattack.runattackAnim = false; runattack.rarque = true; } else if (!runattack.raplque) { var rattpl : AnimationState = animation.CrossFadeQueued ("attackrunLleft"); rattpl.speed = 1.5; runattack.runattackAnim = false; runattack.raplque = true; } else if (!runattack.raprque) { var rattpr : AnimationState = animation.CrossFadeQueued ("attackrunpright"); rattpr.speed = 1.5; runattack.runattackAnim = false; runattack.raprque = true; } else if (!runattack.ratque) { var rattt : AnimationState = animation.CrossFadeQueued ("attackrunturn"); rattt.speed = 1.5; runattack.runattackAnim = false; runattack.ratque = true; } else { runattack.runattackAnim = false; } } }
Thank you for your time! Best regards!
Your answer

Follow this Question
Related Questions
Animation.Play blends previous animation 1 Answer
Problem Animation Blend 1 Answer
Increse animation state 0 Answers
How to play multiple animations on the same game object. 2 Answers