BCE0005: Unknown identifier

I get an unknown identifier on line 23 and 24. The error is here

else if (timerValue <= 0 && timerCoolDown > 0){
timerCoolDown -= Time.deltaTime;

This is my code:

private var lightSource : Light;
var soundTurnOn : AudioClip;
var soundTurnOff : AudioClip;
var timerStartValue : float = 30;
var timerValue : float = 0;
var timerCoolDownStart : float = 40;
var timerCoolDownValue : float = 0;
 
function Start () {
lightSource = GetComponent(Light);
timerValue = timerStartValue;
timerCoolDownValue = timerCoolDownStart;
}
 
function Update () {
if (Input.GetKeyDown(KeyCode.F) && timerValue > 0) {
ToggleFlashLight();
}
 
if (timerValue > 0 && timerCoolDownValue >= timerCoolDownStart){
timerValue -= Time.deltaTime;
}
else if (timerValue <= 0 && timerCoolDown > 0){
timerCoolDown -= Time.deltaTime;
lightSource.enabled = false;
audio.clip = soundTurnOff;
audio.Play();
}
else{
timerValue = timerStartValue;
timerCoolDownValue = timerCoolDownStart;
}
}
 
function ToggleFlashLight () {
lightSource.enabled=!lightSource.enabled;
//Audio
if (lightSource.enabled) {
audio.clip = soundTurnOn;
} else {
audio.clip = soundTurnOff;
}
audio.Play();
}

I get an unknown identifier on line 23 and 24.

An unknown identifier means that there is a name (identifier) that the compiler doesn’t recognize. It is because you haven’t written the code for it or perhaps changed the name of a variable in one place and forgot to do it in another. This is most often due to a spelling error in your code, or that you try to access an identifier that exists in scope you don’t have access to. In this case it appears to be a typo that you have made, because there is no variable called timerCoolDown as the error says.

BCE0005: Unknown identifier: 'timerCoolDown'.

The closest ones that appear to be the ones you wanted to use is in the field declarations:

var timerCoolDownStart : float = 40;
var timerCoolDownValue : float = 0;

As you see, you don’t have timerCoolDown defined in the code, yet you are trying to use it.

// BCE0005: Unknown identifier: 'timerCoolDown'.
else if (timerValue <= 0 && timerCoolDown > 0){
    // BCE0005: Unknown identifier: 'timerCoolDown'.
    timerCoolDown -= Time.deltaTime;