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

    vickca86

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

    http://docs.unity3d.com/Manual/nav-AgentPatrol.html

    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

    AaronAlderman

    Joined:
    Sep 1, 2015
    Posts:
    2
    Hello!

    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

    Elson-Ng

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