- Home /
Question by
Martin575 · May 27, 2014 at 02:46 PM ·
javascriptjavavaluetoken
Unexpected token?
I have this script and Unity is telling me that 'timerscript is an unexpected token'
And I just can't figure out what's wrong with it
var timerscript : timerscript;
var AddAmmo = 1;
function OnTriggerEnter()
timerscript = gameObject.Find("Night Camera").getComponent("CamTimer");
if (AddAmmo <= 0){
timerscript.timer += 20.0;
AddAmmo -= 1;
}
Comment
Answer by meat5000 · May 27, 2014 at 02:49 PM
Does it Require a Capital letter?
var timerscript = Timerscript;
Write is exactly as the script is named.
If the script is called CamTimer,
var timerscript : CamTimer;