i have a 2D platform game with a plane i wanna add animation to, a up and down wards tilt
This is the script im using to make it fly along the X & Y
function Update () {
var x = Input.GetAxis("Horizontal") * Time.deltaTime * PlayerSpeed;
var y = Input.GetAxis("Vertical") * Time.deltaTime * PlayerSpeed;
transform.Translate(x, y, 0);
and with my animation script i have this
function Update () { if (Input.GetAxis("Vertical") > 0.2)
animation.CrossFade ("Up");
else
animation.CrossFade ("Idle");
}
i dont know how to add the "Down" with out getting errors.i can only get the up key to work but . i cant move my plane around any more ? can some one please help me.im a new starter with this java script buti m trying to learn and its fustrating me.