EnemyManager problem

Hello everybody,

I have a problem in Unity.
I follow the tuto with zombunnies on how to manager enemies.
I do almost the same scripts on enemies. The 1rst zombie appear normally (picture 1). But after 3sc when another wants appear, the zombies go through the scene and go in the corners on my terrain, always animated but not moving (see picture 2).
I don’t know why and how it’s possible :confused:

My codes are below:

public class walk : MonoBehaviour {

    Transform player;               // Reference to the player's position.
    NavMeshAgent nav;               // Reference to the nav mesh agent.

    // Use this for initialization
    void Awake() {
        player = GameObject.FindGameObjectWithTag("Player").transform;
        nav = GetComponent<NavMeshAgent>();
    }

    // Update is called once per frame
    void Update() {
        nav.SetDestination(player.position);
    }
}
public class EnemyManager : MonoBehaviour
{
    public GameObject enemy;                // The enemy prefab to be spawned.
    public float spawnTime = 3f;            // How long between each spawn.
    public Transform[] spawnPoints;         // An array of the spawn points this enemy can spawn from.

    void Start()
    {
        // Call the Spawn function after a delay of the spawnTime and then continue to call after the same amount of time.
        InvokeRepeating("Spawn", spawnTime, spawnTime);
    }

    void Spawn()
    {
        // Find a random index between zero and one less than the number of spawn points.
        int spawnPointIndex = Random.Range(0, spawnPoints.Length);

        // Create an instance of the enemy prefab at the randomly selected spawn point's position and rotation.
        Instantiate(enemy, spawnPoints[spawnPointIndex].position, spawnPoints[spawnPointIndex].rotation);
    }
}


2945018--218071--Capture1.PNG

Did you solve the problem? I run into the same one and have no idea what to do…

Are they finding the correct object to run to? If your tag isn’t set up correctly they might not run to the player.

Thanks! I made sure it was ok ,but still happens.
However I re-do it and everything went well… I guess I may click something wrong without notice, otherwise it could only be magic…