Animation Confusion?

using UnityEngine;
using System.Collections;

public class Enemy : MonoBehaviour {
public Transform thisObject;
public Transform target;
private NavMeshAgent navComponent;
Animator anim;
int runningStateHash = Animator.StringToHash("Base Layer.Running");


    void Start()
    {
        target = GameObject.FindGameObjectWithTag("Player").transform;
        navComponent = this.gameObject.GetComponent<NavMeshAgent>();
        anim = GetComponent<Animator> ();
    }
       
    void Update()
    {
        float dist = Vector3.Distance(target.position, transform.position);
        float move = Input.GetAxis ("Vertical");
        anim.SetFloat ("Speed", move);

        AnimatorStateInfo stateInfo = anim.GetCurrentAnimatorStateInfo (0);

        if(target)
        {
            navComponent.SetDestination(target.position);
        }

        else
        {
            if(target = null)
            {
                target = this.gameObject.GetComponent<Transform>();
            }
            else
            {
                target = GameObject.FindGameObjectWithTag("Player").transform;
            }
        }
    }
}

I use this code to animate the enemy that chases you, but I want it’s default animation (walking) to play instead of always running. Where would I declare this? I’ve tried quite a bit, and the last functioning code is the one you are seeing. Any suggestions welcomed, thanks

I feel this is more a mecanim issue than a coding one. Could you post how you have the animator setup in mecanim? Also noticeably I see you are setting the speed of the Enemy using the Vertical axis. Is this how it should be? The vertical axis (W,S, Arrow Up, Arrow Down) is good for controlling say player movement but would not be the best for animation. I’d suggest calculating the speed and using that instead. I think using this might be better suited. I could be wrong about using velocity in this case but I think this is how you would check the speed of an agent.

anim.SetFloat("Speed", navComponent.velocity);


Quite basically, I am using the Walk animation as default, which I want to play when I am outside the circle trigger collider radius on the Enemy, and play Running when I come in contact with the circletrigger