Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

Navmeshagent Patrol

Discussion in 'Navigation' started by vickca86, Oct 17, 2015.

  1. vickca86


    Oct 17, 2015
    I'm using the c# code listed here:

    I'm am a noob to coding and unity. I'm trying to make an enemy patrol a path on a very basic project for my programming class. I've already baked a navmesh and I get that I need empty game objects as points for my enemy to travel to. I have 3 set up but there are no public variables showing up on my enemy so that I can select the points to patrol to. We haven't covered arrays yet and I understand that Transfrom[] is an array but the documentation on the website reads as if all I have to do is plug in the code and select the points in the inspector. I've searched the forum and I've found other sample codes that I believe do the same thing but they are WAY WAY out of the scope of what we've learned in class.
  2. AaronAlderman


    Sep 1, 2015

    So you have created the script and I assume you have saved it somewhere in your project. First simple check is, have you attached this script to the Enemy (GameObject)?
  3. Elson-Ng


    Dec 5, 2014
    Can you post your script and some screenshots of your unity editor? We can help you from there.