I just finished the 7th Chapter of Game Development Essentials. What I want to do now is to reset my progress by discharging the generator when the Player gets inside the outpost and distribute 4 new powerCells around the outpost so the player has to collect them again to open the door again.
Also inside the outPost I gave the lamp a box collider and created an OnTriggerEnter and Exit jscript so the lamp to switch on or off whenever the Player is inside or not, maybe I could use this script for what I want to do. Any ideas ? Thank you.
#pragma strict
var roomLight : Light;
function Start () {
}
function OnTriggerEnter(col : Collider)
{
if(col.gameObject.tag == "Player")
{
roomLight.GetComponent(Light).enabled = true;
}
}
function OnTriggerExit(){
roomLight.light.enabled = false;
}