Walk animation on horizontal or vertical input

EDIT: Solved. See my comment below

Hey all. I want my character’s walk animation to play when I have either horizontal or vertical input… So far I have it working only for vertical input. How can I achieve this?

void Update () {
    	vert = Input.GetAxis("Vertical");
    	anim.SetFloat("walk", Mathf.Abs(Input.GetAxis("Vertical")));
}

Hi, try with this:

if (Input.GetAxis("Vertical")) 
    {
        anim.SetFloat("walk", Mathf.Abs(Input.GetAxis("Vertical")));
    }
    else if(Input.GetAxis("Horizontal")) 
    {
        anim.SetFloat("walk", Mathf.Abs(Input.GetAxis("Horizontal")));
    }