I have a car setup, sorta similar to Mario Kart, the steering is controlled by and analog stick is it possible to set steering to the left to play my "leftlean" animation and when steering to the right play my "rightlean" animation? I tried this
function Update ()
{
if(Input.GetAxis("Horizontal"))
{
animation.wrapMode = WrapMode.Clamp;
animation.Play("leftlean"); // name of the animation clip
}
}
With no luck, any help?