Need Global Fog image effect to disable when inside trigger, then re-enable outside
I am NOT a programmer, and the code I've been stumbling around with just won't work--I feel like I'm so close, but for all I know this a garbage script and needs complete re-writing. Anyway, I need a simple script that disables the Global Fog image effect (it is a C Sharp script) that comes in the Standard Assets pack, but only while the player is inside a trigger box. I need it to re-enable on exit. Here is the code I'm trying to get working:
var IsInside : boolean = false; var Camera : GameObject;
function OnTriggerEnter () { IsInside = true; Camera.GetComponent(GlobalFog).enabled = false; //Where I need Global Fog to Disable }
function OnTriggerExit () { IsInside = false; Camera.GetComponent(GlobalFog).enabled = true; //Where I need Global Fog to re-enable on exit }
It's telling me that GlobalFog is an unknown identifier. Thank you!!