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. Dismiss Notice

Question "Missing" existing script

Discussion in 'Scripting' started by Qriva, Aug 17, 2023.

  1. Qriva

    Qriva

    Joined:
    Jun 30, 2019
    Posts:
    1,108
    There is navigation package inside the project and it provides NavMeshLink component, however I am unable to add this component to any game object.
    upload_2023-8-17_2-25-51.png

    It just does not exist there, but the script itself is available inside C# code, or if I try to add it with
    GameObject > Add > AI > NavMesh Link
    it actually adds gameobject with that component, but the script icon is white/missing.
    upload_2023-8-17_2-25-17.png

    If I enable debug mode and try to select script (with proper icon) it just breaks and throws error, while the white one seems to work.
    upload_2023-8-17_2-31-5.png

    I encountered similar behaviour once this month, but with some other script (I can't remember), but ignored that.
    Can someone tell me what is going on?
    Project is broken? package corrupted?
     
  2. wideeyenow_unity

    wideeyenow_unity

    Joined:
    Oct 7, 2020
    Posts:
    728
    I haven't used NavMesh yet, but I thought that was just implemented at the top of the class within the
    using UnityEngine."..."
    type of reference?
     
  3. Qriva

    Qriva

    Joined:
    Jun 30, 2019
    Posts:
    1,108
    Unity.AI.Navigation
    , but the namespace does not matter I think, there is no problem in the code, file actually exists in the package, the problem is the editor is "broken" in some way and it can't recognize it correctly?
    Hard to say, I don't understand this at all, so I'm looking for some tips from others.
     
  4. tomfulghum

    tomfulghum

    Joined:
    May 8, 2017
    Posts:
    69
    Have you tried restarting the editor and/or deleting your Library folder and letting it re-import? That's my go-to when I encounter scripts that I know exist but don't show up where they should. Which happens too often for my taste, but what can ya do.
     
    Qriva likes this.
  5. Qriva

    Qriva

    Joined:
    Jun 30, 2019
    Posts:
    1,108
    Completely forgot I can delete library. Yes, looks like this fixed the problem, thank you very much!

    The funny part is the old script (previously added to scene) is still white and it works, but there is also the proper navmesh link script available :D