I made a version of this when glass first came out, and it got nice responses. Someone recently brought it back up, so I figured now is as good a time as any to remake it!
For games with rainy environments, having droplets on screen can really add immersion to the game.
My original inspiration for this was Hard Reset: Redux. It was a small feature, but it felt so good. For showcase places, it’s even better.
What does it do?
This creates small “water droplets” on the screen, using Glass material balls to give it a distortion effect.
Features:
- Customization
local Settings = {
-- How many droplets spawn per second
Rate = 5,
-- How large the droplets roughly are (in studs)
Size = 0.08,
-- What color the droplets are tinted (leave as nil for a default realistic light blue)
Tint = Color3.fromRGB(226, 244, 255),
-- How long it takes for a droplet to fade
Fade = 1.5,
-- Update frequency
UpdateFreq = 1 / 45,
}
- Droplet Formation
Using a bit of math.random()
, it gives natural feeling droplet formations (not just single spheres) and gives some nice variations to the droplets.
- Droplet “Running”
Droplets are created via a SpecialMesh, allowing them to be streched down, imitating a “running” effect.
- Coverage Detection
If the camera goes under a roof, or tree, or any sort of cover, the raindrops will stop spawning.
- Camera Angle Conditions
If the player looks down, thus shielding his/her eyes from the rain, the droplets stop spawning.
- Render Settings Compatibility
Because Glass doesn’t render properly on low graphic settings, if the player lowers their settings below 8, it stops rendering. This way, you don’t have to worry about lower settings failing to run the game properly. They just won’t have the extra bonus immersion. (This only works if it isn’t set to Automatic, since Roblox still doesn’t have a way to check graphics quality on auto. Auto will always spawn droplets.)
Warning:
It relies on glass, and therefore brings with it all the limitations of Glass.
Files:
Example place:
GitHub Repository: (Contributions and forks are welcome!)
Roblox Library: