Hey guys , i’m Carlos , i’m 12.I’m newbie at Unity i understand some codes , but i’m not a pro, and javascript is something new to me, but i already used gml (from game maker).So… i have a question… i have 3 animations that i made on 3ds max : walk , jog and run.I’m trying to make my character walk , jog , then, run.I tried this:
function Start ()
{
animation.wrapMode = WrapMode.Loop;
animation[“Idle”].layer= 1;
animation[“walk”].layer= 2;
animation[“jog”].layer= 3;
animation[“run”].layer= 4;
animation[“jump”].layer= 5;
}
function Update () {
if (Mathf.Abs(Input.GetAxis(“Vertical”)) > 0.2)
animation.CrossFade("walk");
else if (Mathf.Abs(Input.GetAxis(“Vertical”)) > 3)
animation.CrossFade("jog");
else
animation.CrossFade("idle");
but no sucess… and sorry for my bad english D:
Can someone tell me what’s wrong with my code?
Thanks in advance
}