Hello i am making a script that is day/night cycle i got the cycle going and now i am working on fog for the night. I want the fog to be turned on when night and off on day. I got the fog working but dont know how to disable it in script. I am new to lightning and could need some help. I have tried RenderSettings.ambientLight. but no setting for the fog.
in the fog script you need to reference the day/night scripts. lets say the day/night script is called DayNightSystem.
in the Fog script you’re going to do something like this. and in the day/night script you should have some way of telling what mode it’s in.
private DayNightSystem dnSystem;
void Start()
{
dnSystem = GameObject.FindObjectOfType<DayNightSystem>(); // thins finds the the games object that is running the day/night script and stores a reverance to to it.
//get the day/night mode. you might want this part moved to Update()
if(dnSystem.getMode == night)
{
turn on fog
}else
{
turn off fog
}
}