How To Having Different Fog Color In Different Area

I am working a railway game and I want there to have a different fog colour when the player drives down the tunnel, How can I change the fog colour in a specific player’s device when they walk into a different area or touch a button?


I want the fog to be white when it is on the ground


I want the fog to be black when it is underground

I don’t have much experience in scripting so I don’t know is there a way to do that.

(P.S It would be great if there is a way to change the fog end too)

2 Likes

I made something which makes this possible yesterday. There is a script in the StarterPlayerScripts and you can edit the fog properties in there. Tell me if you need more help.

fog demo.rbxl (18.5 KB)

4 Likes

Nice! I guess it would do the trick. I will see if I can edit it and make it can change the colour.

just have a LocalScript like this:

--// check for when the player enters the tunnel and then:
game.Lighting.FogColor = Color3.fromRGB(0,0,0) --// this should turn the FogColor in black
--// and once player leaves the tunnel:
game.Lighting.FogColor = Color3.fromRGB(255,255,255) --// this should turn the FogColor to white

I did some small editing and it does what I need.
Thank you a lot.

5 Likes