Search Unity

  1. We are migrating the Unity Forums to Unity Discussions. On July 12, the Unity Forums will become read-only.

    Please, do not make any changes to your username or email addresses at id.unity.com during this transition time.

    It's still possible to reply to existing private message conversations during the migration, but any new replies you post will be missing after the main migration is complete. We'll do our best to migrate these messages in a follow-up step.

    On July 15, Unity Discussions will become read-only until July 18, when the new design and the migrated forum contents will go live.


    Read our full announcement for more information and let us know if you have any questions.

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.