EASY Rain Particle in Unity (Particle System Tutorial)

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hey guys it's matt welcome to speed shooter and today we're going to be looking at creating a rain style particle effect with multiple versions of particles within the same system so we've got the particle for the actual main rain itself and then we've got a sub emitter which will show you the basics of creating something on a collision and then spawning particles off that so you can see the little splash effects that are created i will put the whole project with all the resources on my patreon for you to check them out along with over 120 other scripts and projects you can get hold of but we'll try and do this tutorial with as limited assets as possible so first of all i've got a fresh scene and what i'm going to do is right click in my hierarchy choose effects and choose particle system and now i'm just going to call this my rainfall or whatever you want your particle to be i'm just going to right click the transform and choose reset i'm going to choose the shape and i'm going to set this to box then what we could do is we could set the size to 20 on the x and 20 on the z something like this it's very dependent on what you want to do then we're going to take a velocity of a lifetime because we need the rain to actually fall over a set period of time so on the velocity of its lifetime on the linear we're just going to say random between two constants and we're going to say on the y we're going to say something like minus 25 and then minus 35 so we get some variation in how it actually falls then we're going to look at the bottom which is the renderer and we're going to look for the rendering mode which will be a stretched billboard which means that then the particles can become stretched in a direction that we choose to do then what we can do is we can choose the start 3d size so we can set the start size and make sure we set between two random values so we're going to set x on both cases to 0.1 so it's quite thin we'll set the y between one and say two so we get a slight variation on how long the particles are and we'll also set the z to 0.12 and of course you can adjust any of these options you want yourself then from here we also want to make sure that the start speed is zero because then we just have everything from a uniform style point then we can look at the scene view at the top here and you can see that the particles move all the way down here and that's not really what we want we don't want them to move past the plane that we have which might be our flaw so we'll set the start lifetime something like two see how far they go and maybe one in our case you could lift up your particle if you need it to be higher just depends on how you're going to work we're going to set the original color of the actual particle itself and we're going to turn the alpha value down to say 50 or around halfway so we don't have as vivid looking particles then we're going to go to the emission tab and set that to around 100 because we want to spawn more particles if we want and of course you can adjust the shape value if you need this to be more spread out then we're going to set the color of a lifetime so then we can create a fade at the top when the particle spawns and at the bottom when it ends so we get a more nice look around it so we can set and grab this color and we can just create two points slightly inside select the end points turn the alpha all the way down in both cases on either end so they'll fade in and out when they spawn in then what we're going to do is go to collision because i want these particles to be able to collide with anything that we have in the world so if we set the type to world you can see that now the rain kind of bounces off the top because it hits a collision in the world which is my plane here and it will bounce around now we can set the dampen to around one so it just stops to add some friction we can set the bounds to zero because we don't actually want the rain to bounce around we could add a sub emitter later if you wanted to have some splashback on the actual asset itself and life loss we can have to around 0.5 just so that it loses the power when it hits the ground you can adjust this and make it smaller depending on how you want this to look then we're going to choose to add a new sub emitter which is going to be something that when these particles die or they reach the collision we're going to spawn something new so you can see on our sub emitter here we can do this on collision we can add a new partial system by just clicking the plus and you can see that it spawns the particles there and you can see it'll be now a child of our particle system we can just call this splash or something like that and what we're going to do is going to create ourselves a new material for this and what i've got is a circle rim shader which i've created in photoshop so all it is is a circle with no fill and it has an outline and it's got a glow just to make the edges slightly transparent so then we get a very faded edge we can create a new material by right-clicking create and choose material and then you want to choose the particles standard unlit make sure the rendering mode is fade and then you can add your new sort of circular room material to there and make sure you take the opacity down maybe to the alpha down to 70 roughly you can adjust these accordingly to how you want it to be so we've got that shader now we can go back to our splash sub emitter or our particle which is a secondary particle and you can drag that into the slot and you can see it there almost looks like it could be something like bubbles isn't that pretty you could come and join my patron to get access to this and 120 different scripts assets and projects you can't find anywhere else along with my great assets on the unity store and my website for bonus discounts and be sure to throw a like on this video and subscribe because it really helps me out so thank you for being amazing now in this case we want to use the rendering mode and we want to set that to a horizontal billboard because we want those to appear on the floor when we do it so we want to make them appear horizontally rather than in any direction then we can go to the top of the particle and set the duration to 2 because we don't want these to last as long we can set the lifetime also to 2 and we can set the start speed to 0 because we don't want them necessarily to move around then you can set the 3d start size if you so wish but i'm just going to leave this default at 0.5 and then what i'm going to do is i'm going to set the simulation speed to around 2 which will affect how quickly they will appear then we're going to go to the emission because we want the emission rate over time to be zero and also the rate of a distance to be zero we want the count to be one because it should only happen when the particle collides with the sort of flaw that we have and then the cycle should also be one because we only want to do it once when we choose to do it then what we could do is go to the shape and make sure that we have a box and then again we can go to our color of a lifetime and again create that basic fade so they will fade in and out from start to finish so you get a much more subtle look about it and then one last thing we want to be able to make the particles grow over time as if the water would splash and we will just do the size of a lifetime which is the tick box and we want to make sure that the graph is just from the bottom to the top in a constant gradient all the way up and then we get that look of just growing as it gets bigger and bigger and again you can move all of these particles around and you could go back to your velocity of a lifetime for your original parent particle and you can set the z to between a value of one and two and you get slightly more angled rain let's say if you had more of a rainy day which would have wind that would affect it and you can make yourself a varied set of rain effects with the splashes so let me know what you think be sure to come and check out my great assets on the unity style come and support me on patreon to get access to over 120 different scripts and projects including this one that you can't find anywhere else thanks so much to all my patrons all my subscribers and all the awesome people who watch my videos so don't forget to like comment and subscribe cheers
Info
Channel: SpeedTutor
Views: 38,410
Rating: undefined out of 5
Keywords: unity particle tutorial, rain particle unity, rain particle, unity rain effects, unity rain particle, unity particle system tutorial, particle system tutorial, rain tutorial, unity rain, unity rain particles, unity3d rain effects, unity rain particle effect, mirza, brackeys, sykoo, tarodev, codemonkey, unity tutorial, beginner unity tutorial, 2d rain effect, rain tutorial unity, unity blizzard effect, unity blizzard particle, unity, unity3d, speedtutor, speed tutor, c# tutorial
Id: SrWrUN56UWU
Channel Id: undefined
Length: 8min 11sec (491 seconds)
Published: Thu Mar 10 2022
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.