Survival Shooter Tutorial: Zombunny Movement Stuck

I brought in the Zombunny assets available for the tutorial and applied the Enemy Movement script supplied with it. When I play my game the Zombunny doesn’t follow the player position, but instead walks in place. If I declare a public variable and give the Zombunny a destination of say a mesh in the scene, he will move to that location.

Only the Y position is locked in the Zombunny rigid body.

I bet it’s something super simple I missed but I can’t find any leads and I’m kinda lost.

This is what the script looks like by the 4th tutorial video:

using UnityEngine;
using System.Collections;

public class EnemyMovement : MonoBehaviour
{
    Transform player;
    //PlayerHealth playerHealth;
    //EnemyHealth enemyHealth;
    NavMeshAgent nav;


    void Awake ()
    {
        player = GameObject.FindGameObjectWithTag ("Player").transform;
        //playerHealth = player.GetComponent <PlayerHealth> ();
        //enemyHealth = GetComponent <EnemyHealth> ();
        nav = GetComponent <NavMeshAgent> ();
    }


    void Update ()
    {
        //if(enemyHealth.currentHealth > 0 && playerHealth.currentHealth > 0)
        //{
            nav.SetDestination (player.position);
		//}
        //else
        //{
        //    nav.enabled = false;
        //}
    }
}

The player game object has to be tagged as a Player in the Tag drop-down menu in the Inspector. I thought the script was referencing the name “Player”, which is the name of the character, and not a Player tag. It’s a step I must have missed in the previous tutorial video. So yeah, a super simple fix that I’m now ashamed of. Hopefully this post will save some other newbie the embarrassment. :slight_smile: