Hi
I am trying to activate a fall animation when the character controller is falling to the ground.
I can’t seem to get it working ![]()
I was wondering if there was a solution to the problem!
Here is the animation code I have written so far
function Update ()
{
var controller : CharacterController = GetComponent(CharacterController);
animation["jump"].layer = 1;
animation["fall"].layer = 1;
//Horizontal & Vertical Animations
if (Input.GetAxis("Vertical") > 0.1)
animation.CrossFade("jogForwards");
else if (Input.GetAxis("Vertical") < -0.1)
animation.CrossFade("jogBackwards");
else if (Input.GetAxis("Horizontal") > 0.1)
animation.CrossFade("jogRight");
else if (Input.GetAxis("Horizontal") < -0.1)
animation.CrossFade("jogLeft");
else
animation.CrossFade("idle");
if (Input.GetButton("Jump"))
animation.Play("jump");
}