How to add rain to Roblox games — Transcript
Full transcript
- 0:00We've all been there.
- 0:01>> [music]
- 0:01>> You bump into an acquaintance in line at
- 0:03the grocery store,
- 0:04or maybe you're on your second cup of
- 0:06tea with a grandparent. There's a lull
- 0:08in the conversation.
- 0:10Do you do it? Are you that desperate? Do
- 0:12you reach for the safest possible topic
- 0:14of discussion?
- 0:16That's right, this video is about the
- 0:17weather. Specifically, it's about rain.
- 0:19How to think about rain in Roblox games,
- 0:21several approaches to implementing rain,
- 0:24and the pros and cons of each. Let's get
- 0:26into it. Hey everyone, it's Andrew from
- 0:28Roblox. We experience it all the time,
- 0:30but rain is complicated. [music]
- 0:32Tons of environmental factors affect
- 0:34whether it's raining at all, as well as
- 0:35the duration and severity of that rain.
- 0:38What should cloud cover look like
- 0:40before, during, and after a storm? Then
- 0:43there's the idea of trying to simulate
- 0:44all those droplets as they fall, the
- 0:46path they take in the wind, what happens
- 0:48when they land, how they pool, surfaces
- 0:50[music] becoming slick, and on and on
- 0:52and on. The Weather Channel says a
- 0:54typical citywide rain event involves
- 0:56trillions upon trillions of raindrops.
- 0:58[music] We can't simulate that. So, if
- 1:01we can't simulate it, we have to fake
- 1:03it. This video covers three approaches:
- 1:06a 2D overlay,
- 1:07>> [music]
- 1:07>> hand-crafted environmental art, and a
- 1:10dynamic code-driven system.
- 1:12This first approach is the simplest,
- 1:14which is an overlay. Here we have a
- 1:16screen GUI with a transparent mainframe,
- 1:19a few types of UI gradients for the
- 1:21raindrops, and an overall tint. At first
- 1:24glance, it looks okay. But, this
- 1:26approach has some major downsides.
- 1:28Since it's a screen overlay, the rain
- 1:30effect is identical, whether you're
- 1:32zoomed way in, zoomed way out, and
- 1:35whichever way you're looking. It might
- 1:37look fine at one zoom level or
- 1:39orientation, and really break immersion
- 1:41in another.
- 1:43You have to add logic to detect when
- 1:45you're indoors or in a cave, and turn
- 1:47the overlay off.
- 1:49Also, there's no concept of splashing.
- 1:52If you're using a fixed camera in a 2D
- 1:54game that takes place mostly outdoors,
- 1:56though, this might be a fine
- 1:57implementation. You can add some splash
- 1:59effects to the overlay and call it a
- 2:01day. The next approach is to art the
- 2:03heck out of a scene with the extensive
- 2:05use of particle emitters.
- 2:07Rain, of course, falls from the sky, so
- 2:10we need some particles to do the same.
- 2:12Add a part, make it transparent, anchor
- 2:14it, and stick it above our heads. Attach
- 2:16a particle emitter, let's do emission
- 2:18direction bottom, and
- 2:20yep, those are some sparkles.
- 2:22Not exactly convincing, though.
- 2:25You could use a custom texture, but
- 2:27squashing makes the texture much less
- 2:30relevant. Positive squash values give us
- 2:32vertical growth, which is exactly what
- 2:34we're looking for with rain. Three looks
- 2:36about right to my eyes.
- 2:38We can darken the color a bit, make sure
- 2:40the particles react to light, increase
- 2:42speed, decrease lifetime,
- 2:44>> [music]
- 2:44>> and give them a slight rotation to
- 2:46simulate a bit of wind, and then voila.
- 2:48We're getting pretty close to something
- 2:50your brain might recognize as rain.
- 2:53Because it's attached to a transparent
- 2:55part that we placed and anchored by
- 2:56hand, you don't have to code around it.
- 2:58Just don't [music] stick those parts
- 3:00above buildings, or or if you do,
- 3:01shorten the lifetime, and it won't
- 3:03appear to rain on players while they're
- 3:05indoors. [music]
- 3:06You can use particle emitters in the
- 3:08opposite direction for splash effects.
- 3:10Place a transparent part on the ground
- 3:12with a particle emitter emission
- 3:13direction of top. These emitters
- 3:15probably do need a custom texture
- 3:17[music] since we're not squashing the
- 3:19particles beyond recognition.
- 3:21We also need a simple number sequence to
- 3:23ease the transition from mostly
- 3:25transparent
- 3:26>> [music]
- 3:26>> to just about completely transparent,
- 3:28which creates the illusion of the splash
- 3:31dissipating.
- 3:32Duval Drive uses this approach to great
- 3:35effect along with a third emitter for
- 3:37mist and a fourth for rain dripping from
- 3:39awnings. I especially love this last
- 3:42effect. [music] It's It's so cool. It's
- 3:44so clever. Check it out.
- 3:46Back to our emitters, we also need some
- 3:48clouds, but of course they shouldn't be
- 3:49bright happy clouds, and the sun looks a
- 3:52little large. Let's shrink that down.
- 3:54And the splash effect doesn't look super
- 3:56great on this surface here. Maybe we
- 3:58shouldn't use it. [music] And emitters
- 4:00have a limit of 400 particles per
- 4:02second. So, if we want a downpour, we
- 4:04have to break
- 4:06>> [music]
- 4:08>> By this point though, you might have
- 4:09already figured out the downsides of
- 4:11this approach. You've got to build it
- 4:13all. As the world expands, you're adding
- 4:15part after part after part, carefully
- 4:17[music] positioning and adjusting to
- 4:19achieve the desired effect.
- 4:21Over and over and over.
- 4:23It's possible in a more constrained
- 4:25experience like Dival Drive, but might
- 4:27be more work than you're looking to take
- 4:29on in a larger world.
- 4:31For the final approach then, let's
- 4:32examine what a system might look like.
- 4:34Here's the rundown of how I designed
- 4:36this one. A rainstorm will occur
- 4:38eventually, anywhere from [music] 12 to
- 4:40168 in-game hours after stopping.
- 4:44At the start of a storm, we transition
- 4:45clouds from puffy and nice to dense and
- 4:48dark over the course of 2 hours. And the
- 4:51wind picks up right alongside them.
- 4:53Halfway through the cloud transition, we
- 4:54start spawning rain parts and mist parts
- 4:57around a point of origin.
- 4:58>> [music]
- 4:59>> We ramp rain up from 50 to 100% and mist
- 5:02from 0 to 100%.
- 5:04The particles have drag and respect
- 5:06global wind, so you get a slight angle
- 5:09as the rain falls and can keep rotation
- 5:11at zero. Rain stops after anywhere from
- 5:144 to 12 in-game hours with the same
- 5:16transition of clouds and wind in
- 5:18reverse.
- 5:19The reason I went with mist, for the
- 5:20record, is that splashes need exact
- 5:22careful placement in order to look good.
- 5:25As a 3D artist here at Roblox told me,
- 5:27mist is really forgiving.
- 5:29All key values are configurable in a
- 5:31central file, and they need to be
- 5:33because it's very, very easy to bump
- 5:35into particle limits when you're working
- 5:37with emitters programmatically.
- 5:39If you experience flickering at a
- 5:41distance, this is easiest to notice with
- 5:43the mist,
- 5:44you probably need to start turning the
- 5:46rain knobs down.
- 5:47>> [music]
- 5:47>> That's lifetime, rate, and coverage
- 5:50percentage. For example, if you lower
- 5:52the height of the rain parts, you can
- 5:54shorten the lifetime of the particle,
- 5:56which means fewer on screen at any given
- 5:58moment. Lowering the rate turns a
- 6:00downpour into a shower, and lowering the
- 6:03coverage percentage [music] just means a
- 6:05smaller storm. Mobile devices have much
- 6:07lower particle limits than desktops, so
- 6:10if you implement a dynamic system like
- 6:11this one, test early, [music] test
- 6:13often, and consider enabling streaming.
- 6:17The other major hurdle is roof
- 6:18detection. Particles don't collide, so
- 6:20if you don't perform roof detection,
- 6:22they flow right through [music] houses
- 6:24and bridges and whatever else and can
- 6:26break immersion.
- 6:27My crude version of roof detection
- 6:29involves checking whether there's a part
- 6:31along the path of the rain [music] and
- 6:32shortening the lifetime of the rain
- 6:34particles so that they stop right before
- 6:36reaching that part.
- 6:38This is maybe not easy when there's no
- 6:40wind, but a bit easier. With wind, we
- 6:43have to angle the ray in such a way that
- 6:45it approximates the path of the rain.
- 6:48Think of it like a right triangle, where
- 6:49the ray travels along the hypotenuse,
- 6:51but you measure the leg, which [music]
- 6:53is how far the rain falls before it hits
- 6:55the part.
- 6:56From that height and the rain speed,
- 6:58gravity, and drag, you can determine how
- 7:01long the particle lifetime should be so
- 7:02that it stops right before the part.
- 7:04This approach [music] has some important
- 7:06limitations. The rain part only casts
- 7:08one ray, so the smaller your rain parts
- 7:11are, the more accurate the roof
- 7:12detection is. But, more parts [music]
- 7:15means more emitters and rays means a
- 7:17bigger performance hit to your game, so
- 7:19you have to strike [music] a balance.
- 7:21Also, the rain doesn't actually fall in
- 7:23this neat triangle pattern. Instead, it
- 7:26starts off following a curve,
- 7:27accelerating until it hits terminal
- 7:29velocity, at which point the influence
- 7:31from the wind becomes constant. So, my
- 7:34fixed angle method isn't perfect. If you
- 7:37want to disable roof detection or rip
- 7:38the system out altogether, I've tried to
- 7:41make that as easy as possible.
- 7:43To close things out, I should mention
- 7:44these systems are not mutually
- 7:46exclusive. You can do it all. You can
- 7:48have a system that dynamically enables a
- 7:502D overlay and fires up the splash
- 7:53emitters that you've manually positioned
- 7:55all around the world.
- 7:56I obviously haven't seen the underlying
- 7:58implementation, but that appears to be
- 8:00what Acquire and Square Enix are doing
- 8:02here in Octopath Traveler II.
- 8:05To my eyes, [music] the rain is a 2D
- 8:07overlay
- 8:08and you can see two types of particle
- 8:09emitters, one for [music] rain on
- 8:11impact, the other for rain splashing
- 8:13upward.
- 8:14The fixed camera makes the overlay a
- 8:16great fit and I suspect the splash
- 8:17emitters were placed by hand since you
- 8:20can spot the occasional inconsistency.
- 8:23You can find all the code from this
- 8:24video as a Rojo project in our new
- 8:26Roblox Resources repository. [music]
- 8:29Link right there in the description.
- 8:31If you have strong thoughts about
- 8:32handling weather in Roblox games or just
- 8:34think it's more interesting topic of
- 8:36conversation than I do, be sure to let
- 8:38me know in the comments. Thank you so
- 8:40much for watching
- 8:42and I'll see you in the next one.
About this transcript
This page contains the full transcript of How to add rain to Roblox games by Roblox Creators, generated from the public captions YouTube serves with the video. The transcript has 1,626 words across 265 segments, with the original timestamps preserved so you can click any line to jump to that moment in the embedded player.
What you can do with it
Use the transcript to take notes, quote the speaker, build a study guide, generate a summary with ChatGPT or Claude via the YouTube Summary tool, or export it as a timed subtitle file with YouTube to SRT. You can also re-open it in the transcriber to choose a caption track available on the video.
Free YouTube transcript tool
YouTube2Text is a free YouTube transcript generator — no signup, no daily limit. Paste any YouTube link and get the full transcript instantly, with timestamps, click-to-jump, caption language selection, AI prompts for ChatGPT, Claude, and Gemini, and exports to TXT, SRT, VTT, or Markdown.