Ok so i made this java script and attacked it to my Blackout_object. It works great i walk into the Collider and the "power Outage Sound" plays and the screen goes black. I walk out the lights come back on yadda yadda.
Only issue is i cannot see my players flashlight anymore (While on Camera 2), i can see lens flares seem to appear just not the flashlight > Spotlight. I can walk around using the flairs to guide me but i need the flashlight not to be affected by the Camera2.
var MainCamera : Camera;
var MainCamera2 : Camera;
var SoundOutage : AudioClip;
var SoundPowered : AudioClip;
function Start() {
MainCamera.enabled = true;
MainCamera2.enabled = false;
}
function OnTriggerEnter(other : Collider) {
if(other.tag == "Player") {
MainCamera.enabled = !MainCamera.enabled;
audio.PlayOneShot( SoundOutage );
MainCamera2.enabled = !MainCamera2.enabled;
}
}
function OnTriggerExit(other : Collider){
MainCamera.enabled = !MainCamera.enabled;
audio.PlayOneShot( SoundPowered );
MainCamera2.enabled = !MainCamera2.enabled;
}
// On Camera2, i have it set like this.
// Clear Flags - Solid Color
// Background - Black
// Culling Mask - Nothing
Everything works great, just wondering how to allow the flashlight object to be seen?
It's Tagged: Flashlight. Thanks in advance.
↧