Questions for about making a weather system

Hello all,

In a game, I am working on with some friends, we are wanting to create a weather system, that only appears outside, but once you go inside the building it stops. I’m not quite sure how to start creating a weather system, nor how to create the weather that only appears outside.

Thank you,

  • eiz_a
3 Likes

Raycast upwards and or in several directions from either the camera or the character and if it hits something they’re probably under cover.

1 Like

You can use plugins like this. Rain Plugin - Roblox

2 Likes

I have looked into this plugin, we would prefer to make it editable through code.

1 Like

There is a wonderful rain module by buildthomas to make rain system easily

So you can just with two functions handle raycasting etc

rainModule:Enable()

rainModule:Disable()

For adding more stuff like snow, fog just change the image Id

4 Likes

Thank you! I’ll test with this and mark this as the solution if it works!

I am getting the error of “RenderStepped event can only be used from local scripts”. The script is located in ServerStorage.

I dont think it works server side and it’s not the best thing to do it serverside as it causes unnecessary load on the server. Use it from a local script client sided.

Okay, thank you for your assistance!

One last quick question, how could I create different weather types within the module? Like for example, you said you could create snow by changing the fog ImageId.

You would have to change the texture with :SetStraightTexture and :SetSplashTexture. Then after changing image you can set the speed to something slow and the rate to high to imitate fog bbehaviour. Alternatively for fog you can change it through lightning too or add smoke particles.

1 Like

Would I have to create separate functions for “:Enable()” if I wanted to make say a thunderstorm?

Yes, you can do that. You’ll have to change to disable it then change property and then enable it for different weather

Do you think instead of making multiple functions, should I just use “Rain:Enable()” but before that edit the properties?

You don’t need to do this when you use that module and want it to only show rain outside. It automatically detects whether you are inside or outside a structure and shows rain where appropriate.

2 Likes

Scripts don’t run in ServerStorage. ServerStorage is designed to store scripts not run them.

Oh my! Didn’t see this until now, I meant ServerScriptService, not ServerStorage but thank you!