- Home /
gameobject references runtime script in scene file
I added some UI components to my scene and now I keep getting this error whenever I try to run the game. What does this error even mean, the exact line in the reads
GameObject (named 'Canvas') references runtime script in scene file. Fixing!
which tells me that the object in the scene is using runtime scripts (which would make sense to be doing at runtime) and that it's fixed whatever problem it was having (obviously not, as the game still does not run).
I also get a ton of warnings saying that scripts are missing on objects (core scripts that are part of Unity), even though these scripts are still showing in the inspector without any issues.
Anyone else encounter this problem and have a solution?
Having exact same issue. No solution yet. Game runs fine in editor, refuses to compile / build.
I am also having this issue for every script that Unity defines as 'runtime script', no idea why! But is updating the references of my scripts and showing this message exactly as you posted. I am creating my prefabs from a bundle.
In my scene the scripts are working but I am getting 180 warning logs and 89 error logs. Very annoying, in addition of the doubt if what I am doing is right or wrong.
Despite Collider and others inheriting directly from Component, if you try to inherit from Component yourself Unity will go nuts.
Answer by danielfelixalves · Oct 08, 2015 at 12:12 AM
Possibly not the only time you would see this error, but you will see it if you have a script attached to a Game Object and you decide to remove its inheritance to MonoBehaviour (e.g. because you don't need it)
It becomes a "Runtime" script which (most likely) should have not been attached to a Game Object to begin with.
Maybe in this occasion the Game Object named "Canvas" contains an attached script to it which does not extend MonoBehaviour or ScriptableObject.
Answer by amzin7000 · Aug 23, 2015 at 02:43 AM
I noticed this happened to me whenever i tried creating a world space ui. Deleting it removed the errors. Creating a new one created the same ones as before.
In the end I backed up my project and fixed it by clicking Assets>Reimport All and the UIs and everything else worked fine.
Answer by tibithegreat · Sep 26, 2015 at 05:55 PM
This may be an old thread but I had the same issue and I found on a chinese blog I think that the problem was that one of my scripts didn't inherit MonoBehaviour.
Answer by gregroberts · Jul 29, 2015 at 09:34 PM
My only solution was to go back to a backup of the project that I had made two days earlier, and to re-do the tasks that we had recorded in the worklogs across that time. We worked on this for 2 solid days, that was the solution.
Wow! Great it worked for you! In my case this is not an option though :(
Your answer
Follow this Question
Related Questions
UI is not visible on Android lollipop after upgrading from 4.6 to 5. 0 Answers
Positioning Context Sensitive Popup Menu Using 4.6/5 UI system 1 Answer
How do I keep an ui element in side of the canvas when scaling? 1 Answer
Unity 5 GUI Buttons Won't Show When Built 0 Answers
unity scrollview doesnt bounce 0 Answers