How can you stop rain from happening indoors/under roofs?

I have a rain thats a particleemitter, how can I stop it from going under roofs? Ive tried basically everything and everyone elses answer doesnt work at all

There must be a way because obviously most games dont have rain indoors

You could just negate the rain

edit: (if the rain is a part with particles as a child)

under the models tab there is a button called “negate” insert a part and select your rain and your part and click negate, then your part will delete a portion of the rain based off of the parts size and position

Raycasts.

distance/speed = lifetime

Have a Part the size of your room (under cover of a roof) then use GetPartsInPart to see if the player’s Humanoid is one of the Parts inside the room Part. If it is then turn off the ParticleEmitter.

that wouldnt make any sense and the rain falls under the part lol its not like the rain is confined in the part

1 Like

but how would you delete a particle in a particleemitter

but like again if i just turn off particle emitter it would just look weird and all the rain would stop

You could just duplicate the rain and adjust lifetime so that you have rain hitting the roof and the ground around it

that would basically solve everything unless you want to make some complicated script to handle everything which would not be very ethical

edit: (and move the rain parts around)

Raycasts.

You would need a ton of parts, one for each place particles can fall from. You would call ParticleEmitter:Emit(1) on each ParticleEmitter each time you want a rain drop to fall. You should uncheck Enabled on the ParticleEmitter, so that it doesn’t automatically start emitting.

Right before you call ParticleEmitter:Emit(1), you should raycast downwards:

If we then take the distance from the start of the raycast to the hit point, and then divide that by the speed at which the particles travel, then we get the value we want to set the Lifetime property on the ParticleEmitter to.

After setting the LifeTime property correctly, we call ParticleEmitter:Emit(1).

what i mean is you can duplicate your rain part and move it around so that it will hit the roof and the ground

I don’t know exactly how the rain works, but I’d shoot out a ray every heartbeat or renderstep straight up above the players head, and if it hits something, stop the rain. and if it doesn’t hit something, restart the rain or do nothing if the rain is already playing. I don’t know how exactly the rain works though, so this reply might not be helpful…

@N_aps Please check out the illustrations I made. Let me know if you understand.

wouldn’t that be a lot of work? couldn’t he just make multiple rain parts and adjust them around the map?

You just generate a grid of rain parts high above the player, then move them when the player moves.

Most all of them rain plugins just insert scripts that stay… Many of them have options that can do this. I use one where the rain will hit objects and remove itself if set to do that. Anyways, it’s all right there, just a matter of finding it in the scripts. Deep dive reverse engineer it. Probably learn a bunch of new tricks in the process to do with this. They sure have them.

Most of the plugins publicly available are super simple, buggy and unrealistic.

Well, you have to touch them up, if needed… But that wasn’t the point. They do have the logic to stop that rain like you’re looking for… You may be able to just look at it and know exactly what to do. Considering where you are now, I’m thinking you would.

I remember seeing this post a while back. I used the search tool to find it again.