Search Unity

Resolved MonoBehaviour is red but no error in console How to debug?

Discussion in 'Scripting' started by AlanMattano, Jul 19, 2021.

  1. AlanMattano

    AlanMattano

    Joined:
    Aug 22, 2013
    Posts:
    1,501
    I do not know how to fix this bug or debug it.
    If I open Visual Studio, the MonoBehaviour is underlined in red.
    There are no errors in the console.
    I am using 2020.3.14f LTS with the last updated pachages.

    SOLUTION
    This is odd; I do not understand why but
    If I copy my project and open it using the Unity Hub, the problem is fixed.
     
    Last edited: Jul 20, 2021
  2. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    38,752
    Joe-Censored and AlanMattano like this.
  3. AlanMattano

    AlanMattano

    Joined:
    Aug 22, 2013
    Posts:
    1,501
    I have tried with no success.
    • Unity, go to Edit < Preferences < External Tools (left part of the Window) Visual Studio 2019
    • Project > Reimport All
    • Updating VSCode package: Window > Package Manager > Visual Studio Code Editor
    • And also Visual Studio Editor

    I did not understand well this process:
    https://forum.unity.com/threads/no-suggestions-in-vscode.955197/#post-6227874

    I left this project because of this error. But now I'm trying to fix it. Hours trying to find the origin: 16hs

    SOLUTION
    This is odd; I do not understand why but
    If I copy my project and open it using the Unity Hub, the problem is fixed.

    Any Clue?
    I make a compare and these are some different files plus a mygame.sln

    difference.png
     
    Last edited: Jul 20, 2021