Follow AI with Navvigation won't work

So i am making a zombie survival game and i attached this script to the zombie. It is supposed to follow the object with tag “player”, i also made a permimeter float named speed on animation controller. I have 2 animations. idle and walk. between them are thransactions. there are also 2 conditions. if speed is greater than 0.1 it will start walk animation and if less than 0.1 it will start idle animation. But for some reason it isnt working. Can you guys help me please?

SCRIPT:

using UnityEngine;
using System.Collections;

public class EnemyController : MonoBehaviour {
NavMeshAgent nav;
Transform player;
Animator controller;
// Use this for initialization
void Awake () {
nav = GetComponent ();
player = GameObject.FindGameObjectWithTag (“Player”).transform;
controller = GetComponentInParent ();
}

// Update is called once per frame
void Update () {
nav.SetDestination (player.position);
controller.SetFloat (“speed”, Mathf.Abs(nav.velocity.x) + Mathf.Abs (nav.velocity.z));
}
}

I don’t know if i posted this to the right forums but if i didn’t please tell me for next time :slight_smile:

switch your zombie’s inspector to debug to see if the private variables are set and check the case of your tag