Hi,
This seems like it should be easy but I’m having problems with it. I’m not familiar with the getcomponent so maybe I’m a little off, but here’s what I have.
I get the error: Object reference not set to an instance of an object
var fogScript;
GetComponent(GlobalFog);
GetComponent(GlobalFog);
fogScript = GetComponent ("fogMaterial");
fogScript.gameCamera.camera.renderer.fogMaterial.SetColor ("_FogColor", Color.grey);