Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Question Visual Studio doesn't recognise NavMeshAgent variable

Discussion in 'Navigation' started by Nepholius, Sep 1, 2020.

  1. Nepholius

    Nepholius

    Joined:
    Aug 10, 2020
    Posts:
    2
    Hey everyone, first of all I'm a newbie in Unity. I have been learning Unity Game developing for a while. Then, I got this issue which I still cannot find out how to resolve it. When the NavMeshAgent variable is supposed to be in green color, it stays the same as normal texts. And unity doesn't accept this way. Thus, it doesn't work. I'll leave a screenshot to make my self clear. Hope you guys can help me because I googled it in many forums including here but i couldn't have solved yet. Thanks in advance.
    Note: the version that I currently use is Unity 2019.4.7f
     
  2. Nepholius

    Nepholius

    Joined:
    Aug 10, 2020
    Posts:
    2
  3. topofsteel

    topofsteel

    Joined:
    Dec 2, 2011
    Posts:
    999
  4. Deleted User

    Deleted User

    Guest

    Your script is not recognized as a MonoBehaviour; this is why VS doesn't acknowledge NavMeshAgent.