I'm trying to make it so when you pick up a gameobject the spotlight color will change.
var lt: Light;
var MainCam : GameObject;
function Start () {
MainCam = GetComponent.();
}
function Update () {
if (Input.GetKeyUp(KeyCode.E))
lt.color -= Color.blue/ 2.0 * Time.deltaTime;
}
The code will not work, how can i fix it?,
↧