keep getting this error "Unexpected token: 10." any ideas whats wrong?

var health = 15;

function Update () {
    print(health);
}
 
function OnTriggerEnter (other : Collider) 
    {
     if (other.gameObject.CompareTag("Enemy"))
       {
        health -= 5;
       }

       if (health = 10)
       GameObject.Find("(1)Green").SetActiveRecursively(false);
       
    }

Your second “if” statement is trying to set health to 10, which javascript doesn’t like (and probably isn’t what you meant, either). Try this instead:

if (health == 10)