Search Unity

New C# scripts created from Unity Hub launched project get an error "No Monobehaviour.."

Discussion in 'Unity Hub' started by jcasegraham, Jul 2, 2019.

  1. jcasegraham

    jcasegraham

    Joined:
    Mar 31, 2015
    Posts:
    2
    This only happens when I launch a new project from Unity Hub on Windows. If I launch Unity directly new scripts are fine. It is also fine on my mac whether launching from Unity Hub or otherwise.
    These are brand new scripts created by right clicking in the assets window and selecting create -> C# script. Before opening them or editing them in anyway the Inspector give the message "No Monobehaviour scripts in the file, or their names do not match the file name." When trying to drag and drop onto an object I get the "Can't add script" message. The file name of the script absolutely matches the class within the script.
    Tried changing the External Script Editor in preferences and changing back as well.
    Tried reinstalling Unity Hub
    Tried Installing new Unity version packages in Unity hub.

    I've searched for solutions and tried all I can to no avail.

    Any help appreciated.
     
  2. safaGH

    safaGH

    Unity Technologies

    Joined:
    Mar 12, 2019
    Posts:
    224
    Hello @jcasegraham,
    Can you report a bug through the hub bug reporter so we can look into the editor and the hub logs ? Thank you !