- Home /
Script attached to 'Object' in scene '' is missing or no valid script is attached.
Script attached to 'Light' in scene '' is missing or no valid script is attached.
Why am I getting this warning everytime I build? I have no Light object in my scene (There was, but I deleted it already).
I also get:
Script attached to 'Restart' in scene '' is missing or no valid script is attached.
I still have the restart object in my scene, but the script attached to it is working properly, and it's definitely not missing or invalid.
It also says UnityEditor.HostView:OnGUI()
below it.
How do I get rid of this annoying warning that comes up everytime I build?
It also just shows " when telling me the scene. So I think this is a bug or something. I also couldn't find anything here on Answers or Google.
Thanks!
Answer by psyydack · Jun 11, 2014 at 11:06 PM
Same question here solved : http://answers.unity3d.com/questions/581238/building-error-after-43-update.html
Summary : I figured out that one of prefabs in the 'Resources' folder was the reason of the error.
That's not the same question/case and it doesn't fix the problem that's posted here.
Answer by iwaldrop · Mar 09, 2017 at 05:52 AM
In my case I found that the meta file for the script was checked in in a conflicted state. The team uses SVN, so the left right and working copies were all in there. I manually fixed the meta file and it seems to have worked. You could probably also just delete the meta file and let unity regenerate it, but the guid would probably change, which is why I opted for doing it manually.
Answer by Jinja · Nov 21, 2016 at 07:21 AM
I got this error after deleting some scripts but not deleting some prefabs that used those scripts. Even though those prefabs are not being used anywhere, they generated those warnings during builds. Check your prefabs for missing script references and delete them (or remove the script component)
Answer by WoodyDRN · Mar 09, 2019 at 09:27 PM
I had kind of the same error, but I had a ScriptableObject class called Item, but the filename was Items.cs - then I got this error. Had to rename the file to Item.cs
Answer by hoskarg9619 · Jul 13, 2020 at 09:31 AM
I had the same problem with some scripts. The problem was that I create some scripts with the first letter in lowercase. When I change the names of the scripts and classes with the first letter in uppercase, the game works fine. Try to check the names of your scripts.,I have the same problem with some scripts. The problem was that I create some scripts with the first letter in lowercase. When I change the names of the scripts and classes with the first letter in uppercase, the game works fine. Try to check the names of your scripts.
Your answer
Follow this Question
Related Questions
blackberry error (Author Id, etc...), no script added ye... 1 Answer
Problem creating GUI.Window, Help please! 1 Answer
Unable to open scripts 2 Answers
My buttons do not appear when paused? 2 Answers