Hello Unity3D i have a question about combo attacks.See i have been researching about how to make combos but i still dont get it.What im trying to understand is how is it really done like i do i need to add like crossfade to animation play or is it another way of do ing it?Sorry if this make no sense.it because im not sure how its really done but like i got something started already and i want to know if its correct
#pragma strict
var LastAttack: int = 0;
function Update(){
if(Input.GetMouseButton(0) && LastAttack == 0){
animation.Play("atk1");
yield WaitForSeconds(.3);
if(!Input.GetMouseButton(0)) {
LastAttack = 0;
}
else {
LastAttack = 1;
}
}
if(Input.GetMouseButton(0) && LastAttack == 1 ){
animation.Play("atk2");
yield WaitForSeconds(.4);
if(!Input.GetMouseButton(0)) {
LastAtk = 0;
}
else {
LastAtk = 2;
}
}
if(Input.GetMouseButton(0) && LastAttack == 2){
animation.Play("atk3");
yield WaitForSeconds(.3);
if(!Input.GetMouseButton(0)) {
LastAtk = 0;
}
else {
LastAtk = 0;
}
}
}
function CheckInput() {
yield WaitForSeconds(.3);
if(!Input.GetMouseButton(0)) {
LastAtk = 0;
}
else {
LastAtk = 1;
}
}
Also LastAttack is an unknown identifier.is it because im using js instead of cs?