But whenever I try to debug it, I always get the “Namespace ‘UnityEditor’ not found, maybe you forgot to add an assembly reference?” message.
Like any sane person, I asked google what I should do.
After a good deal of searching, I didn’t find any answers.
From what I gathered, a bug in the Mono editor caused this, but that was nearly 2 years ago. It can’t possibly be still around.
Anyhow, any and all help is appreciated.
Are you trying to build a debug build from within mono developer?
As Sarper Soher suggested - you shouldn't build the debug build from within mono developer. It is not relevant for work with unity. If you wish to debug, once you regularly run the game, you need to attach the debugger to your running instance. Look for: "Run -> Attach to process" Then select the unity editor.
You need to check the unity console: CTRL + SHIFT + C, if it is not opened. There you get all warnings, errors (wrong syntax and exceptions), and debug logs. You can focus away from the editor and back in order to refresh and make unity compile your latest changes. (notice the right bottom processing icon that animates when unity compiles your changes). Also, double clicking the specific error lines you get in the console, should pop the code editor on the corresponding line at which the error or log are happening.
It seems the method for debugging using MonoDevelop has changed with the latest upgrade to 4.1. Before, you could build and run from Mono to debug with breakpoints, but it appears you no longer can do this using the simple “Build” and “Debug” buttons in Mono.
To do so now, you have to use “Attach to Process” on the toolbar or in the “Run” menu, and attach it to the Unity Editor. Now, when you hit play in the Editor, it will bring you to Mono so you can step through from your breakpoint.
Are you trying to build a debug build from within mono developer?
– SarperSI believe I am.
– hourglass