Hello, I'm on a 2D platform game, i made a simple CharacterController script and i am now working on the animations. I made a script for that but it doesn't seem to work. I don't know, they may be other ways to make animations work. This is the animation Script, shall I show you the Move Script ?
function Start () { animation.Stop(); animation.wrapMode = WrapMode.Loop; var jump = animation["jump"]; jump.layer = 1; jump.wrapMode = WrapMode.Once; var run = animation["run"]; var idle = animation["idle"]; } function Update () { var controller : CharacterController = GetComponent(CharacterController); if (controller.IsMoving()) { animation.CrossFade ("run"); } else animation.CrossFade("idle"); }
It says that IsMoving is not a propper Method.