This is the code for my project
#pragma strict
function Start () {
}
function Update () {
function OnTriggerEnter(){
gameObject.light.enabled = false;
}
function OnTriggerExit(){
gameObject.light.enabled = true;
}
}
these are the errors in my code
Assets/light.js(8,10): BCE0044: expecting (, found 'OnTriggerEnter'.
Assets/light.js(8,26): UCE0001: ';' expected. Insert a semicolon at the end.
Assets/light.js(9,34): BCE0044: expecting :, found '='.