- Home /
animation priority
i have a basic human model with walk idle and attack animation to let the model walk i use animation cross fade but my aim is to play the attack animation while walking so that the animations overlap but the attack animation should not be affected the same for attacking while standing
thats the script idea without attacking
var xspeed = 0.1; var rotateSpeed : float = 1.0;
function Update ()
{
var xMove : float = Input.GetAxis("Vertical") * Time.deltaTime * xspeed;
transform.Translate(Vector3(0,0,xMove));
transform.Rotate(0, Input.GetAxis ("Horizontal") * rotateSpeed, 0);
if (Input.GetAxis("Vertical"))
animation.CrossFade("walk");
else
animation.CrossFade("Idle");
}
thanks for help
Answer by Paulius-Liekis · Mar 10, 2012 at 12:54 PM
Look into animation layers and AddMixingTransform
Your answer
Follow this Question
Related Questions
Play simple animations on demand 1 Answer
Play either the first or second animation on an object without specifying its name 1 Answer
Can I use Mecanim animation clips in Legacy? 1 Answer
Animation of a specific GameObject doesn´t play 1 Answer
Enable a component after a specific amount of time? 4 Answers