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

Script doesn't exist+MonoBehaviour has unknown format

Discussion in 'Editor & General Support' started by GuineaPigJones, Feb 15, 2015.

  1. GuineaPigJones

    GuineaPigJones

    Joined:
    Feb 15, 2015
    Posts:
    3
    When I try to attach a script to an object, it tells me script doesn't exist. I looked at similar problems and started screwing around with some stuff. I ended up clicking add component from the object's inspector to make a new script, which unity yet again tells me doesn't exist. Yes, I am saving these before the message comes up. Then I tried changing the attached script and got the message "MonoBehaviour has unknown format!:"
     

    Attached Files:

  2. Jmanpie

    Jmanpie

    Joined:
    Oct 7, 2012
    Posts:
    132
    There must be an error on the script this means it doesn't save in a way unity will read it so post the other errors
     
  3. GuineaPigJones

    GuineaPigJones

    Joined:
    Feb 15, 2015
    Posts:
    3
    Sorry, I posted all the errors available, you can even see the console in the bottom left of the screenshot.
     
  4. Jmanpie

    Jmanpie

    Joined:
    Oct 7, 2012
    Posts:
    132
    If there is no error on the script then maybe its a internal error.
     
  5. GuineaPigJones

    GuineaPigJones

    Joined:
    Feb 15, 2015
    Posts:
    3
    I made this script while following a video tutorial found here:

    What I have is shown at 25:17, so I am sure it isn't that.
     
  6. Dmitrii_R

    Dmitrii_R

    Joined:
    Jun 12, 2018
    Posts:
    1
    This can happen if your class name does not match the file name
     
  7. jacksonkr

    jacksonkr

    Joined:
    Jan 22, 2013
    Posts:
    22
    This was happening to me because I had prefabs that had missing scripts. The prefabs weren't even being used in the game but this still caused my build to fail.