how can I get my character to default "idle" when nothing else is being pushed?? Here's my code... sorry its sloppy.
`
var speed = 3.0;
var rotateSpeed = 3.0;
function Update () {
var controller : CharacterController = GetComponent(CharacterController);
//Rotate around y - axis
transform.Rotate(0, Input.GetAxis ("Horizontal") * rotateSpeed, 0);
//Move Forward / Backward
var forward = transform.TransformDirection(Vector3.forward);
var curSpeed = speed * Input.GetAxis("Vertical");
controller.SimpleMove(forward * curSpeed);
if(Input.GetAxis("Vertical")){
animation.CrossFade("walk");
}
if(Input.GetAxis("Horizontal")){
animation.CrossFade("walk");
} function Start () { animation.Stop(); animation.Play("idle"); animation.wrapMode = WrapMode.Loop;
animation["run"].layer = -1;
animation["walk"].layer = -1;
animation["idle"].layer = -2;
animation.SyncLayer(-1);
var attack = animation["attack"];
attack.wrapMode = WrapMode.Once;
animation.Stop();
animation.Play("idle");
}
@script RequireComponent(CharacterController)`