- Home /
Issue adding UI Button Unity 5
I'm getting this error message when i try to add an UI Button and play the scene:
"GameObject (named 'Button') references runtime script in scene file. Fixing!"
My button is a child of a Canvas.
Does this happen each time you add a button, or only once? Is the button being added using the menu, or is it contained within a prefab?
Every time i try to add it. I have a canvas so, i right click on it then on UI -> Button. That is it. When i try to play my scene, i get this error. I can run the scene but my buttons don't react.
Answer by mattbadley · May 17, 2015 at 04:43 PM
I also had this issue which was driving me crazy - there was no logical reason to why it happened (it seemed to happen after I made some button/canvas alterations while in play mode accidentally).
Ever since then all my canvas and events objects were corrupted. If I deleted and start again, all would be fine until I switched scenes and then back again - this process would cause the canvas to corrupt.
I seem to have half fixed it by doing 'Assets > Reimport All' from the menu. I still get canvas errors but when entering play mode the errors fix themselves.
I have no idea what's going on here but it's pretty frustrating!
Thank you '$$anonymous$$attbadley', that fixed it for me. I still get the errors too.
Answer by warmerice · Apr 26, 2015 at 11:43 AM
btw, i "fixed" mine by removing those components that have (scripts) that are causing the error. I dont know if this is a good way of fixing it but it did.
had the same problem removed the libary folder in my unity project leads to a reimport and solved the problem
Answer by OnlyFails · Oct 08, 2015 at 10:43 AM
I "fixed" the issue by using NGUI instead of the one clumsily half handed to us by Unity. (Who ironically tried to steal NGUI's design and make it better after the guy who made it refused a position at their company)
You may want to clarify your facts - the nGUI guy actually did accept a position at Unity and helped them work on their new GUI system for a year. As far as I know he has never said anything negative about his experience there.
Your answer
Follow this Question
Related Questions
Button rect transform top 0 Answers
how to test Buttons 1 Answer
UI button in Panel not clickable 2 Answers
UI Button Link breaking after scene load 0 Answers
Button position scaling weird 1 Answer