- Home /
The type or namespace name `GridSelection' could not be found. Are you missing a using directive or an assembly reference?
Ive looked online for this error and people have stated several things such as moving your scripts to a folder in your root called "Editor". Ive done that and now several more of my scripts just broke and its beginning to irritate me because either its a Unity Editor namespace error (for building and test which is not my case) or its a suggestion like move it to a folder which originally ive had it in a folder named "scripts". Ever since the move to an "Editor" folder its just showing this error everywhere...
The type or namespace name `GridSelection' could not be found. Are you missing a using directive or an assembly reference?
The type or namespace name `charinfo' could not be found. Are you missing a using directive or an assembly reference?
The type or namespace name `terraingen' could not be found. Are you missing a using directive or an assembly reference?
The type or namespace name `settings' could not be found. Are you missing a using directive or an assembly reference?
The type or namespace name `playerinfo' could not be found. Are you missing a using directive or an assembly reference?
The type or namespace name `mousecontrols' could not be found. Are you missing a using directive or an assembly reference?
The type or namespace name `camcontrols' could not be found. Are you missing a using directive or an assembly reference?
Answer by Bunny83 · Jun 28, 2015 at 09:12 AM
The editor folder is only for editor scripts. Runtime script must not be placed in a folder called "editor". Things like "mousecontol" and "camcontrol" most likely are not editor script. The others probably as well. So move them out of the editor folder.
Editor scripts are scripts that extend the editors functionality and aren't directly related to your game / application.
Okay now that makes a lot more sense. So that worked but the first error remains.
Well, are you sure that you have a class called "GridSelection" somewhere in your project? The compiler simply tells you that at some point in your project you try to access a class called "GridSelection" but the compiler can't find any class with that name.
Sorry, but we can't help you any further since "GridSelection" isn't a standard class and we know nothing about your project. We don't even have the code that throws the error.
Absolutely positive I have the class, the grid system was what I was working on lately. Im not sure if it was a bug because I copied the class itself other than the automatically generated headers, recreated one so unity generated a new one with the proper names and it still couldnt find it.
I had everything backed up on bitbucket but when I was about to just pull the file for it, it suddenly worked. Not sure what happened there but it just worked out now.
Thanks Benny!