- Home /
Unknown Identifier?
I have two scripts added to a camera, one of which is my "GameManager" that keeps track of score, etc.
At the top of this GameManager script, I have variables declared like this:
static var score = 0;
In the other script attached to the camera I am trying to access the score variable through GameManager.score, but it simply shows the error "BCE0005: Unknown identifier: 'GameManager'."
I don't understand how that works because I am accessing that score variable just fine through another script that is attached to another object through GameManager.score... Is it because the GameManager script was added after the first script attached to the camera, or am I doing something else wrong?
You need to define "Game$$anonymous$$anager" generally you wont call your variables the same names as their type (e.g. var float : float) If your script is called Game$$anonymous$$anager you'd call the variable gm or game$$anonymous$$anager just to make it easier to read.
If I try and define it like var gm : Game$$anonymous$$anager = GameObject.Find("Camera").GetComponent(Game$$anonymous$$anager), the error turns into "Game$$anonymous$$anager does not denote a valid type"...
Answer by Eric5h5 · Aug 06, 2010 at 12:33 AM
If you're mixing languages, read this: http://unity3d.com/support/documentation/ScriptReference/index.Script_compilation_28Advanced29.html
I had this error while using iTween (a C# script) with my predo$$anonymous$$ately JavaScript project. The solution is as that document states - to put your script to compile last outside the StandardAssets folder.
Your answer
Follow this Question
Related Questions
Unknown Identifier "target" 3 Answers
BCE005: Unknown Identifier :'KDefaultraycastLayers' 1 Answer
BCE0005: Unknown identifier 1 Answer
Fade to white after being killed - iPhone game 2 Answers
Why Unknown identifier? 1 Answer