Ring Effects | Unity Particle Effects | Visual FX

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
what's up guys this is dem keys and I'm back with another episode of the unity particle effects series in this video I'm going to be teaching you how to create various types of ringing effect using unity particle system real quick I wanna mention that I've already done a tutorial on the basics of the unity particle system so if you want to check that out the link is going to be in the top right corner and in the description down below that being said let's begin so first of all you're going to need to make sure that you are in the tall layout to change your layout click in the top right corner on the layout menu and select all that's going to bring up this layout next drag your game view and set it next to the hierarchy because throughout the tutorial we are not going to need to look at the game view we just need to look at the scene view next right click in the hierarchy and click particle system this is going to create a particle system game object for us and change the position of the game object is zero on all axes also select the directional light and drag it down so that it's not obstructing our view and then in the particle system expand the shape module and change the shape to circle so now you'll see instead of the particles going up they're going sideways next change the radius of the circle to 5 and you'll notice that the particles are being emitted from within the circle we don't want that we want the particles to be emitted from the edge of the circle so check em it from edge now as you can see the particles are being emitted from the edge of the circle next we want to make sure that the particles don't move they remain in the same place after their spawn so change the start speed from 5 to zero once you do that you'll notice that the particles are spawned and remain and even die in the same place alright before we continue hit Q on your keyboard so that you're not in Translate mode anymore you're in pan mode and the transform gizmo is not obstructing our view all right next expand the emission module and change the rate over time from 10 to something like let's say 500 so once you do that you'll notice that it's already starting to look like a ring and you'll notice a few imperfections over here this gives a sort of puffy look now if you want to create a little bit of disturbance so maybe you want to make it look like some sort of ring of smoke then you can add some disturbance to these particles now since these particles are not moving one of the ways that we can add disturbance to these particles is to change the start lifetime from 5 down to 2 once you do that you'll start to notice a little more disturbance in these articles it's not that the particles are moving it's just that because these particles are being spawned and destroyed it looks as if there's a sort of disturbance going on in this room of course if you're not happy with this small amount of disturbance you can always enable the noise module once you enable the noise module you'll notice things start to go a little crazy the reason for that is by default the strength of the noise module is set to 1 which is way too high for what we are trying to do here so change it down to something like 0.02 and then you start to notice a little bit of disturbance as compared to before so this is how you can create a simple puffy ring but let's say you don't want the puffy kind of effect you want a smooth ring so first of all disable the noise module and then under the shape module change the arc mode from random to loop and instantly you see the ring becomes smooth now let me show you exactly what is happening here I'm going to take the rate over time from 500 down to 10 and I'm going to change the start lifetime to 1 so that the particles only last for one second each in fact I'm going to take the start lifetime down to 0.9 so this is what is happening in loop mode the particles are being spawned in a loop they have the sort of circular motion going on earlier we were in random mode and so this is how the particles were being spawned randomly all right so before we continue I've made some changes to explain things so I'm just going to change it back to what it was before set arc mode to loop set start lifetime to two and set the rate over time to 500 all right so since these particles are being spawned in a loop and there's so many of them that's why it looks like a really smooth ring but these are actually just the particles that are being spawned it's not any sort of trail in fact 500 rate over time for a start lifetime of two is actually too much so these particles are sort of overlapping making the ring thick so I'm going to change the start lifetime to one and once I do that you'll notice that the ring becomes a little less thicker and I'm going to change the rate over time down to 50 so you can see the particles over here now I'm going to increase it to 100 you see it becomes thicker then 200 it becomes even more thicker and then I'm going to take it all the way up to 500 and it's a really smooth ring now let's try to add some sort of effects with colors in this I'm going to enable the color over lifetime module and we are going to set a new gradient over here so if you don't know how the gradient editor works just let me explain real quick the keys at the bottom control the color and the keys at the top control the Alpha which is a transparency and you can add multiple keys on each side to customize the gradient in whatever way you like so we are going to start by adding two keys over here the very first key we are going to set its color to let's say blue the next key we are going to set its color to something a little lighter so the change in color is not very sudden and the same thing for the next one set the color to something even more lighter and for the very last one I'm going to set it to something dark because we're going to set the Alpha value to zero over here all right now the Alpha keys so I'm going to create one alpha key over here and then I'm going to select the last Alpha key and change its value from 255 to zero so that basically means towards the end of its lifetime the particle is going to start to become invisible also this color key right here I want you to change its color to something a little more light and then drag this alpha key over here alright so now we have a circular sort of motion going on within the particle system whereas the particle system is not actually rotating it's just because of all the settings that we have done it looks as if there's a circular trail going on in the particle system I'm going to change the simulation speed of the particle system from 1 down to 0.1 so that you can see what's happening in slow motion again these particles are not actually moving it's just that each particles color is changing based on this gradient this gradient controls what the color of the particle is going to be throughout its lifetime and because of the way we have set it up you are getting this kind of an effect all right so this is a trail kind of effect and we are doing this using no trails at all that's great but there may be certain situations where you might actually need to use trails so we're going to take a look at one of those instances now disable this particle system but before that set the simulation speed back to 1 otherwise it's going to be going in slow motion the entire line so disable this particle system and create a new particle system so right click in the hierarchy and click particle system again change the position to zero on all axes and then just as we did with the previous particle system under the shape module change the shape two circle set the radius to five and check em it from edge don't change the mode just yet because I have something to show you I'm going to show you two examples of how you can use trails to create a ring kind of effect also change the start speed from five down to zero so the particles are being spawned in the same location and now we need to add a script to our particle system game object so hit ctrl shift a and create a new script called particle script or v open this up in monodevelop alright now this is going to be a really simple script all we are trying to do is rotate this game object so create a public vector3 variable called speed and in the update method type transform rotate speed multiplied by time dot there's our time all right now even though we are only going to be specifying the speed on one axis I still decided to make speed a vector3 variable just in case you want to specify the speed on multiple axes instead of just one and we are multiplying the vector three with time.deltatime so that this rotation is not framerate dependent hit save go back to unity and before we set any values over here I want you to understand exactly why we are setting the value so go back into translate mode by hitting W on your keyboard or clicking on this button here and make sure that you are looking at the transform gizmo in the local axis of this game object to do that make sure this button here say is local if it doesn't if it says global just click it it's going to change to local and once you are looking at the transform gizmo and the local axis you'll see that instead of Y pointing up Z is pointing up that is how this game object has been oriented so we need to rotate this game object on the z axis that being said set the value of Z to 100 and now when you play the game you see that our particle system is rotating and these particles are being simulated in the local space of the particle system game object so the particles rotate along with the game object even though they aren't actually moving all right so now I want you to make sure that you don't stop the game until I tell you to the reason is we are going to be changing some of the settings in the particle system and if you stop the game those changes are going to get reset once I'm done making all the changes at the end I'm going to tell you what you can do to actually have the changes persist even after you have stopped the game but in the me I want you to make sure you don't stop the game at all we are going to be doing everything during runtime alright so the first thing we're going to do is create a material right click in the project panel click create material don't worry about this this change will actually persist because this is an asset that we are creating named this trail mat oh five and with this material selected change the shader of this material to particles additive next we are going to set a texture for this material click select to select a texture and by default you should have this default particle texture in your project you don't need to import this it should just be there by default so select this and now in the hierarchy select our particle system go down to the trails module and first of all enable the trails module once you enable the trails module you will notice a warning over here saying assign a trail material in the renderer module that's because there is no material assigned to the trail material slot so drag and drop this material that we created into the trail material slot and now we have assigned a trail material to our particle system now the reason you're not seeing any trails over here is because the trails are being simulated in the local space of the particle system so we need to have the trails simulated in world space to do that check world space and once you do that you see this starts to become one long trail it's actually multiple trails blending together alright so we do have a nice trail going on over here but you'll also notice there's a lot of imperfections in this trail what you're seeing is actually the particles themselves so first of all change the start lifetime to one and then once the older particles have died out the newer particles will only have a start lifetime of one so this is what our particles and their trails actually look like so first of all we are going to change the start color to make these particles invisible so we are not changing the color we are just changing the alpha value from 255 down to zero once you change it down to zero you'll notice that even the particles have disappeared the reason for this is in the trails module inherit particle color is checked so the trail is actually inheriting the color from the particle itself so uncheck this and then the trails have their own color independent of the particles color all right now you'll notice that these trails seem to be dying out abruptly the reason is die with particles is checked so the trail eyes as soon as the particle dies so uncheck this and then the trails are still going to be alive for a small period of time after the particles have died and just as we did with our previous particle system you can also set the mode from random to loop and you'll have a different kind of effect a more let's say uniform motion going on and you can increase the emission from ten to let's say fifty though fifty might be a little too much but let's go with it for now actually I don't think fifty is too much because our start life time is set to one we should probably set this to five and then you'll notice this trail starts to get a little more thick the reason is that the trail is actually lasting much longer so the trails start to overlap and I don't know if you can notice it but my frame rate is starting to drop so I need to change the rate over time down to let's say 20 and once the older particles died out and the newer particles formed my frame rate became much better so the values that we are looking for our start life time 5 and rate over time 20 you'll have to excuse me if you see me changing the values a lot as if I'm not able to make up my mind the reason is that I don't actually have these values memorized I don't write all of them down I just have an idea of what I want this effect to look like and I set the values based on that all right so now we have a sort of nice smooth trail going on some of them actually overlapping which is giving it a more thick feel you can change the rate over time and you can also change the start life time to see what different kind of effects you can get so for example I've changed to start life time down to 2 once the older particles die out then you start to notice that this trail becomes a little more thin and at some point you'll actually start to notice imperfections well these are not actually imperfections it's just that this texture of this material is being stretched out to make that trail and as you can see this texture is round so when it's stretched out the trail isn't exactly uniform but when we have many of these trails overlapping each other it gives you a smooth look so if you said the start lifetime to two maybe you want to set the rate over time to something like 50 and see what effect that gives you in my case it's already starting to look like a thick trail and the entire trail has pretty much the same look it looks like a smooth ring all right so this is is a nice smooth white ring but there is much more that you can do by changing the color over lifetime and color over trail properties under the trails module so color over lifetime here is the color of the trail over the lifetime of the particle color over trail is the color of the trail throughout the trail basically now you can set both of these two different colors you actually have multiple options you have color which is a solid color you have gradient you have random between two colors and random between two gradients and the same goes for color over trail so in our case let's try a solid color let's try setting this too right now you'll notice initially when it was white as I started bringing it towards red we have this sort of border being formed around the trail so this is an interesting effect that you can come up with and this is just one example of the many different kinds of effects that you can come up with just by messing around with the properties here and there and of course you can also change color over trail all right so now one last thing I want to show you is how you can actually take this a little more further so let's say I'm going to enable the velocity over lifetime module and I'm going to change the type of the value from constant to curve I'm going to disable the X curve and the Z curve and I'm going to leave the Y curve enabled because that's the only curve that we are going to be editing and change the space from local to world then go down to the curve editor and double click in the center to create a key over here double click at the end and drag both the ends down and drag the middle key up don't worry about precision you just need to make sure it's somewhere in the center and then that gives you this sort of effect all right so now you'll see the sort of thickness forming in the trail basically what we are doing is we are changing the velocity of the particle making it go down first and then up and then gradually down again I'm going to change the rate over time down to something like 10 and then you should start to see the difference over here you can actually see these trails going up and down and that's giving you a sort of wavy motion you can increase the lifetime to let's say 5 and that gives you this interesting effect so yeah that's it I hope this video is helpful head over to my channel if you want to check out more videos there should be two videos up on the screen right now as well don't forget to check out my music channel the link should be up on the screen right now if you'd like to help me out with the donation my paypal email address is mentioned up on the screen and in the description down below don't forget to like share and subscribe leave your comments below and I'll see you guys next time
Info
Channel: Abhinav a.k.a Demkeys
Views: 118,482
Rating: undefined out of 5
Keywords: unity particle system, unity particle effects, unity particles, unity tutorial, unity tutorial 3d, unity tutorial for beginners, visual effects, unity visual effects, unity effects tutorial, particle effects, particle system, unity ring effect, unity circle particle, unity particle trails, unity particle ring, unity trail effect, unity visual fx, trail effects, unity beginner tutorial, demkeys, gamedev, game development, unity tutorial 2017, unity 5 tutorial, learn unity 5
Id: CVsZ98TSEwI
Channel Id: undefined
Length: 15min 45sec (945 seconds)
Published: Thu Apr 27 2017
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.