- Home /
'Unknown Identifier' - cannot recognize other scripts
This hasn't been a problem with the scripts so far, all of these scripts are old scripts i did a few months ago, but all of a sudden i get a "BCE0005: Unknown identifier: 'OtherScriptName'." error when on the other script i have OtherScriptName.staticvariable. It's like suddently something happened to the game where it can't recognize other scripts, like there's some kind of problem with compiling. All of my scripts are in javascript. I can't think of any changes I've made recently that would cause this problem... any thoughts?
Answer by Mike 3 · Dec 21, 2010 at 06:07 PM
If you put one of your scripts into Plugins, Standard Assets or anything similar, it'll be compiled earlier and won't be able to link with your other scripts that are compiled later. The errors should point at the file in the wrong folder, move it out of there and it should fix it
That makes sense but all the scripts are in the same folder in a seperate folder from standard assets, named Scripts
Huh. so i had the scripts divided into different folders inside that Scripts folder, so maybe that was making them compile at different times? i moved all the scripts into the same folder and now it's working, so you were right. Thanks! By the way, would something similar happen to materials attatched to prefabs if they were not in the same folder? I've been having trouble with the links between the two breaking randomly, and haven't been able to solve this problem before...
For the scripts thing, yeah it'll be a na$$anonymous$$g issue with the subfolders. For the prefabs thing it shouldn't matter which folder your scripts are in, as long as you don't try move either of them from outside of unity
wow.. I was not aware of this early compileing of scripts based on file location... this is the first bit of text I have read on the matter.
nice link I found with other details. http://answers.unity3d.com/questions/20801/global-variables-static-keyword-unityscript-javasc.html