Walk to , jog , then run

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
:smiley:

}

This is an incredibly complex problem to get right properly- however, there is a wonderful package called the Unity Locomotion System which solves all of these issues in a way that is far better than anything you or I could do. Best of all, it’s free for anyone to use, provided as a free addon to the Unity Engine.

Oh! Whoops , sorry! Thank you man =D
But hey , i’m curious now.
Why i would get sued by sega? O: