In the game I’m working on I want users to be able to press a key for example the F key, and have that enable, and disable for the scene. I would also love to have a key that swaps between a sunny skybox, and an darker one. Is there any way to do this?
You can edit this to work on a button
http://wiki.unity3d.com/index.php?title=Fog_Layer
Cool, thanks!
i have wrote the fog script ask if you want it. Its j script
If you wouldn’t mind giving it to me, then I’d love it.
so sorry for the wait i made a mistake fixed though you need to go to edit project settings then input. Change were it says size to one bigger then edit the new one added at the bottom which says jump to the following:
were i have put f can be any button you want the code automatically accounts for that here is the code:
private var Fog = false;
function Update () {
if(Input.GetButtonDown ("fog"))
if (Fog == false)
{
RenderSettings.fog = true;
Fog= true;
}
else
{
RenderSettings.fog = false;
Fog = false;
}
}
There is meant to be a image but it hasn’t come through when i view it just in case when you are in project settings and have added the new input (increased size by one) change it were it says negative button, positive button, alt negative button, alt positive button all to f(not caps)
thanks a load man!
