Tuesday, July 21, 2015

Unity 3D: Console displays wrong folder path for files

Sometimes, especially if you're bouncing projects between different users, your Console may show that your source files are in a different folder location than where they're actually stored.

For instance, let's say you have a null reference error in a "DoStuff ()" method. Normally, the second line on the console will show you the method name, and if you double-click the error, it will take you to that line of code. However, if you see a path to the source file and it's not valid (say, a path on someone else's computer), then it won't open MonoDevelop and you've got a problem.

There is, fortunately, a simple fix. Close the project, go to the project's directory, and find the "Library" folder. Delete everything inside of it, and open your project again. Unity will have to re-build the entire asset library, so it will take longer than normal to open, but once it does, your issue should be resolved. If it isn't, re-sync your MonoDevelop project ("Assets > Sync MonoDevelop Project").

If you have a team working on a project together, shipping the whole project back and forth is a bad way to work for a number of reasons. Look into version control!

No comments:

Post a Comment