Making a rain system

Thats weird, seems like rx or rz is always the same, can u print them?

Ye, here;
1st - Z was 0
2nd - X was 90

I would actually use a particle emitter rather making a bunch of parts. However if you want to keep going down this paradigm I would just say get the spawners x and y size and set that as the limit when doing a non pure function such as `math.random()`

1 Like

You know what I hate about particle emitter, the particle goes inside the buildings which isn’t that great.

Well you can make spawners for specific buildings and adjust the life time of the particle to match the time when it touches the building. Much more efficient than creating 1k parts

1 Like

I don’t understand what you mean?

You can adjust the life time of the particles so that they respawn after they reach a certain height

Great idea. But I don’t think other games use Particle Emitter for rain? do they?

Why would you care, just do it?

1 Like

Just wanna ask. Thanks for all your help, I really appreciate it.

2 Likes

I created a rain system which consists of following the player it does not cover an entire area but I find the same problem as you it goes through buildings (because I use ParticleEmitter)…
Would you have a solution to this ?

its why you should use parts. What i do is that i use raycasting and tweening to make the raindrops fall from the sky. Raycasting is to shoot down rays to the surface, possibly like 5000 studs downwards from the main rain part, this allows me to get hit positions so that i can tween it to surfaces. This also prevents the rain drops from going through roofs and objects.

However, there are a few things to consider:

1. Part Capping: If you don’t implement a part capping system (limiting the amount of parts spawn), over 1000+ parts will be used to simulate the rain opposed to limiting it to 150-300 parts (which is fine). If you want to prevent lag at ALL COSTS, part capping is something you should do.

2. Rain Range: The bigger the range, the more seperate and less frequent the raindrops become (this is due to part cap, increasing the cap will solve this issue but at the cost of more parts spawning, best way to do it is to simply reduce the range).

3. Useless Parts: Always make sure that parts that don’t have raycast results don’t stay hanging, not only will it slow down the game over time, It will also look weird because they are always stuck on the cloud. The best way to do this is to make it destroy parts (or simply use debris but its not recommended) when the part doesnt recieve results.

Another way with dealing with this is simply using a custom roblox particle system that has collision (Like this) and some scripting.

Or even better, use raycasting and the normal roblox particle system to make it so that if there’s anything above the player… the particle emitter stops emitting rain particles.

Part Caching is also an option, but in my experience, its a bit problematic at times.

All in all, These are my suggestions for a rain system. All you need to think about is the coding complexity and the performance impact. If the method has too much impact on performance (if you tested) or is too complex to code, then go for something else.