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

Need a C# wizard

Discussion in 'Scripting' started by Wilc0, Nov 6, 2020.

  1. Wilc0

    Wilc0

    Joined:
    Jun 3, 2020
    Posts:
    20
    So I'm working on a character controller and i have multiple scripts. Currently I havent had issues and recently they are now popping up. the errors im getting are.

    {
    "resource": "/C:/Users/asus/Character Controller/Assets/Scripts/Editor/AxisKeysDrawer.cs",
    "owner": "csharp",
    "code": "CS0246",
    "severity": 8,
    "message": "The type or namespace name 'AxisKeys' could not be found (are you missing a using directive or an assembly reference?) [Assembly-CSharp-Editor]",
    "source": "csharp",
    "startLineNumber": 4,
    "startColumn": 30,
    "endLineNumber": 4,
    "endColumn": 38
    }

    {
    "resource": "/C:/Users/asus/Character Controller/Assets/Scripts/Editor/InputManagerEditor.cs",
    "owner": "csharp",
    "code": "CS0122",
    "severity": 8,
    "message": "'InputManager' is inaccessible due to its protection level [Assembly-CSharp-Editor]",
    "source": "csharp",
    "startLineNumber": 4,
    "startColumn": 22,
    "endLineNumber": 4,
    "endColumn": 34
    }

    {
    "resource": "/C:/Users/asus/Character Controller/Assets/Scripts/Editor/KeyboardTrackerEditor.cs",
    "owner": "csharp",
    "code": "CS0246",
    "severity": 8,
    "message": "The type or namespace name 'KeyboardTracker' could not be found (are you missing a using directive or an assembly reference?) [Assembly-CSharp-Editor]",
    "source": "csharp",
    "startLineNumber": 4,
    "startColumn": 22,
    "endLineNumber": 4,
    "endColumn": 37
    }

    Anyone that could help me out via discord or otherwise would be greatly appreciated.
     
  2. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    36,762
    I've never seen that kind of error output but the errors are pretty clear: you're missing some code, such as KeyboardTracker and AxisKeys...
     
    Bunny83 likes this.
  3. Wilc0

    Wilc0

    Joined:
    Jun 3, 2020
    Posts:
    20
    I know thats what it says.. but i promise i have those scripts as well.. its just not linking them or pulling from them?
     

    Attached Files:

  4. Wilc0

    Wilc0

    Joined:
    Jun 3, 2020
    Posts:
    20
    last part of what im workin on. all scripts should be posted now
     

    Attached Files:

  5. Wilc0

    Wilc0

    Joined:
    Jun 3, 2020
    Posts:
    20
    My AxisKeys is a struct.. and the keyboardtracker is its own script.
     
  6. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    36,762
    Put a clear typo error in one of the files for the classes it can't find. Does the file get compiled and show an error?
     
  7. Wilc0

    Wilc0

    Joined:
    Jun 3, 2020
    Posts:
    20
    When i go into unity, it doesnt show errors or prevent me from using the tools.. but i do have an error message in the console related to the ones i get in visual studio
     
  8. Wilc0

    Wilc0

    Joined:
    Jun 3, 2020
    Posts:
    20
    its like it cant find the classes or the permission for them is to low and cant be called twice.. this has been driving me nuts.
     
  9. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    36,762
    Can you move the primary class files (not the editors/drawers/inspectors) into the same folder where the class that is trying to use it is located?

    Also, comment out all the lines giving errors, then let it compile, then uncomment them, see if things are happy.

    You can also try reimport all, rightclick in the project.
     
  10. Wilc0

    Wilc0

    Joined:
    Jun 3, 2020
    Posts:
    20
    I dont believe so. Because its and Editor script, i believe it should remain in the editor file. tried the comment method.. no bueno
     
  11. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    36,762
    You gotta keep after it... what if you make a brand new empty class named precisely what the one it can't find is?

    Can you now use it? Or does it complain of duplicates?

    Try combos man, gotta try combos...
     
  12. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    36,762
    What about blowing away the projects Library/ScriptAssemblies directory? Maybe the OS is holding a lock on a previous build of one of the DLLs... Windows does that sometime.
     
  13. Wilc0

    Wilc0

    Joined:
    Jun 3, 2020
    Posts:
    20
    blow away the library/script assemblies? i dont know if i understand how to do that. tried the combo. no work either.
     
  14. Stardog

    Stardog

    Joined:
    Jun 28, 2010
    Posts:
    1,887
    Make sure the MonoBehaviours are not in an Editor folder. Right-click and reimport the files.
     
  15. Wilc0

    Wilc0

    Joined:
    Jun 3, 2020
    Posts:
    20
    ... turns out my script is fine.. it was my software not being updated.. super. anyway, i appreciate the respnoses yall