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

Resolved "No MonoBehaviour scripts in the file"

Discussion in 'Scripting' started by Gabo19x, Oct 27, 2020.

  1. Gabo19x

    Gabo19x

    Joined:
    Oct 23, 2020
    Posts:
    104
    Hola Soy nuevo, tengo la versión 2019.3.9

    El error apareció de repente en TODOS mis scripts luego de abrirlo en el mismo día, además no me deja agregarlos a mis objetos. En los foros e encontrado el mismo problema pero las soluciones no han aplicado a mi problema. Lo que e intentado es borrar la carpeta biblioteca, revisar los nombres de los scripts que coincidan (coinciden), mirar el .NET; pero no han servido. Algo a añadir es que paso algo lo mismo con otro proyecto pero le di la culpa a la actualización (Por haber comenzado en el otro proyecto deje atrás este). No se si sea algo importante pero los scripts me los deja abrir normalmente.

    Tal vez sea un problema de compilación o del motor unity (pero no se como arreglarlo si es el caso). Necesito su ayuda... Para poder seguir en el desarrollo de mis proyectos.

    (Si necesitan mas información no duden en pedirla)
     
  2. orionsyndrome

    orionsyndrome

    Joined:
    May 4, 2014
    Posts:
    3,070
    Joe-Censored likes this.
  3. Gabo19x

    Gabo19x

    Joined:
    Oct 23, 2020
    Posts:
    104
    I already reviewed those forums, and they did not work for me, also it appeared at the same time in the scripts and I do not know if it works but the scripts do not use each other (most of them),

    One question, the error literally in the code? or something to do with something else...
     
    Last edited: Oct 28, 2020
  4. Joe-Censored

    Joe-Censored

    Joined:
    Mar 26, 2013
    Posts:
    11,847
    Unity cannot add your MonoBehaviour scripts to GameObjects until it has successfully compiled your scripts. To successfully compile your scripts, there must be no compile errors in the entire project. Scripts aren't compiled individually, but as a whole. A single compile error in any script, even if unrelated to this script or from some third party source, will cause the compile to fail.

    So go to the Console and check for any errors. If there are compile errors, resolve all of them starting from the first in the list. If you're having trouble resolving them, you can post the complete error description with line numbers and the script using CODE tags in the forum and people can help resolve them.
     
    orionsyndrome and Bunny83 like this.
  5. Gabo19x

    Gabo19x

    Joined:
    Oct 23, 2020
    Posts:
    104
    Gracias joe-Censored, tienes toda la razón, es decepcionante que ese sea el error... :(.
     
    Last edited: Oct 29, 2020