- Home /
The referenced script on this Behaviour is missing! on empty scene
I have three of these errors. But they remain, even when I delete eveything thats in the hierachy for that scene.
You deleted a script that was used in a prefab or object somewhere?
The referenced script on this Behaviour is missing! Thats all I get to work with, usually this means a object in the scene is missing a script, wish the error would at least say what object the error is on. Usually I can find it by deleting objects in the hierachy untill its gone to get a global idea where I have to look. But now I can delete everything and this error remains.
Its the only scene in my game that has this error.
I got the similar one. It also comes in as three errors. All same. But it popped up after Unity Engine Crashed.
Answer by Bluestrike · May 25, 2013 at 07:55 AM
My issue was caused by a script setting a gameobject its hideflag to invisible in hierachy. And since it was a emtpy gameobject with a script I had no visual location in the scene vieuw either. Deleting the script did not reset the gameobects hideflags. I simply wrote a script that made all gameobjects hideflags to default in the scene. And could then select them from the hierachy to delete them. I would post it but I can't find where I placed it :/
Answer by Karsnen_2 · Dec 06, 2011 at 03:00 AM
Okay I got it working. I will let you know my solution. But it may not be the same for you too.
I created script (say 'A') and it attach it to a prefab. Now this prefab was attached to the script (say 'B') which says there is an error. But later I happen to delete the A script from the project folder but I did not remove the component from the Prefab.
So I removed it. It kinda worked.
Hope it is kinda the same for you too.
Answer by AFrisby · Dec 17, 2011 at 12:44 AM
I managed to get this too - but I found a workaround of sorts.
Hit CTRL+A to select everything in the scene; then in the heirachy, unselect everything using CTRL+CLICK on each item (this takes a while. :|), then delete.
Somehow CTRL+A manages to select the item, even though it is invisible to the heirachy.
Hopefully this helps someone else out too.
Thanks ctrl + a indeed selects whatever the problem is. But unselecting everything by hand will take a day and it looks like unity does not support (un)selection of an entire tree at one.
Answer by DaveA · Nov 07, 2011 at 06:34 PM
At that point, I would leave the scene empty, delete the scene, and start again. Hopefully you have backups, so you could copy/paste from the backup to the new scene keeping an eye out for that error. Seems like something in a 'cache' or something. But also, do you have an Editor scripts which may depend on something that got deleted?
Your answer
![](https://koobas.hobune.stream/wayback/20220613034229im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Assets/Scripts/PlayerController.cs(22,25): error CS8025: Parsing error 0 Answers
need help, with greater than statment 1 Answer
Another Null Reference Exception 0 Answers
unity error error CS1525: Unexpected symbol `(', expecting `identifier' 2 Answers
The name `DebugUtils' does not exist in the current context 1 Answer