UE4 - Tutorial - Lightning Beam Particles (Request)

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hello guys and gals and welcome to a new tutorial at today's video is a request somebody has asked how we can set up a beam particle system to act like a lightening now you will notice that right now I have the viewport frozen and the reason that I have the viewport frozen is just because before we begin I do just want to give out a quick warning for photosensitivity and those of you that do suffer with it due to the nature of these particles are going to be a lot of rapid movements and some bright lights so if you do suffer with photosensitivity please do be careful going ahead with this tutorial due to the nature of the particles I'm going to be making them in a much slower fashion than normal so when they do play they're going to be moving slower than some users may want but I am going to show you how you can set up the speed so that if you wanted these to be faster or slower you'll be able to change that with that out of the way let's begin so here you can see I've got a few different little beams here that are just going from one sphere to another and if we were to move these spheres around you can see there our particles will follow both their target and their source and this is something else I'm going to show you guys how to set up so let's get rid of all of our lovely little pieces and we will begin the very first thing that we're going to do is we're going to make a material and it's just going to be very very simple because these are just a beam we just need something there to to be a color for us so we're just gonna make a material and we'll call this lightening underscore em and we'll open this guy up and we'll just change our blend mode to translucent and a shading model to unlit and then we will right-click article color so that we can change our particle color inside of our particle system rather in the material and we'll plug that into the emissive color and then just to get our little pattern we're just going to use a radial gradient exponential which we will then multiply by holding M and left-click by the alpha channel of our particle color and this will allow us to change how see-through our lightning will be inside of our particle system so we'll put this into the opacity so we'll press apply then I'll close this down and then we'll right-click particle system and we'll call this lightning underscore P and we'll open this guy up and before we mess around with the actual particles we're just going to go to our required tab and drag our worth material in like so and then we can just drop a particle system down onto our ground in our world so that we can see it in real time in our world rather than real time inside of the particle editor now what we're going to do is we're going to set up the actual beam so we're just going to nice noises we're going to right-click type data and we're going to set beam data you'll notice that it's disappeared and there isn't it's disappear it's because it's just switching over the data it will reappear shortly and we should just get a strange line that looks like it's growing in random directions see is we you can see here it hasn't got the material on it yeah but you can see we've got a line growing in a random direction now we don't know we can see that we're getting a little bit of our material in there but because we have a color of a life it's disappearing so what we're going to do is we're going to delete color of life because we want this to just persist well right-click and then we will go to color initial color and we'll just leave it as it is for now that's looking cool and we're just going to give it a nice bright blue we'll just go ramp the value up to about 20 so we get a nice glow in there now what we're going to do is we're going to actually set this up so that it stops moving around quite so randomly and that we can set this up with both a target and a source because we're using a beam data we now have access to new menus in our right-click one of which is beam and we can just simply set up source like so and beam target now to get these to actually work inside of our world we need to give them somewhere to go towards so you can see right now it's kind of trying its best based on the default values in here which are 50 50 50 to 50 50 50 if we were to go ahead and change some of these values around we'd get a different source so if we were to say maybe 500 on the Zed you can see now it's flying up because it's trying to reach that point but we're not gonna be using that what we're going to be using is a different method so our source method we're going to set this to actor and you can see we have source name this is very important because this is essentially a variable that's going to tell our particle system where to wait a point what we're going to be using to access that we need a name so we're just going to call this source nice and simple and now we can assign an actor to our source name of source and we'll do the same in target changes to actor and the target name we'll just call this target and we'll save this real quick and then what we can do with our particle selected you'll notice we don't actually have access to any sort of variables right now we can't see anything we can't see any of our source or a target that we've just created to get access to this what we need to do is under instance parameters we just need to add two new elements under element zero we're going to type in source type is an actor this is how we've set this up and in our second one target parameter type actor because that's what we've called it and everywhere it's a drag in a sphere and just duplicate this by holding alt and dragging we can do is we can select our particle and underneath our source actor we now have actor and a drop-down we can use the little eyedropper click on an actor for a source and there you can see that we moved a particle to a source and then what we can do is we can eyedropper a target this isn't going to work right now and the reason this isn't going to work is because our particle isn't lasting long enough to reach its target so if we were to go into a lifetime and set our lifetime to zero and our particle will just live forever we but you'll notice that it's going to reach its maximum height and then it's going to snap to our target and the reason this is happening is because by default beams are set up with a speed that pushes them in their velocity we don't need any velocity but if we turn this off right now we're probably not gonna get anything happening here we go you see it's just slowly creeping along towards its target to change this we're gonna open up theme data and we have speed which is currently set to 10 we're just going to set to zero which makes it instant and now you can see if we restart the level in the sim it will just immediately pop up on its target and we can move the target and it will update the particle and we can move the source and it will also update the particle it's a little bit big so we're just going to change the initial size to a constant I'm going to set this to maybe five like so on all and now we have a much thinner line it's probably still a little bit too thick but we can change that later so now what we're going to do is we're just going to change a spawn up a little bit we're getting the constant of 20 we don't need a constant to be 20s we're just going to set this to zero and burst list we're just going to make sure this is one however a beam will always be present anyway but we're just going to set this up just for the sake of having it there in case we wanted to change some of this around later on so how can we make this wavy well if we right-click and head to beam we have noise and with noise selected we can tick low-frequency enabled and if we increase our frequency to say something like 20 you can see now it's trying to move things around it can't currently move them correctly because we don't have any interpolation points right now we just have point a and point B for a noise to work we need points between the two as between the two initial points of a and B the start and the end locations do this we're going to head to beam data and under interpolation points under beam we're just going to increase this to something like 20 this would give us some more points to use you can see that shifted it ever so slightly as well it's still not quite doing what we need it to do that's what we're going to do is we're just going to change and noise range right now and noise range is just a constant of 50 50 50 it's just pushing all of the interpolation points in exactly the same direction we're going to change this over to a vector uniform which is now set it back to default because everything is zero and if we say max of 20 max is 20 max of 20 this is where it's going to start to wiggle so before we increase this any further I want to talk about the speed to change the speed if we scroll down inside of our noise we can find noise speed and if we were to open this up you can see we have a constant which allows us to set up a noise but then we can offset this with the noise a lock time zero is just going to rapidly flick between different noises the higher the number the slower this will be so if a now I'm just going to set this to one which is just going to make it step between noise frequencies once every second so you can see here it's blinking once every second obviously if you want this to be fast set it to a lower number for the sake of the tutorial and for those with the photo sensitivity I'm going to leave this going quite slowly for now so we have our noise setup we've got twenty twenty twenty we can push this as well into our negative two negative 20 so we get a bit more noise going downwards and I can see we're getting this really nice jittering in there which is really really cool like so see if we had this going a little bit quicker it would look a bit more dynamic than it currently does but as I say for this for the sake of safety I'd rather keep it quite slow for you guys and now that we've got one in there we can right-click we can say emitter and we can duplicate this say if we wanted to beams and then we have two beams instead of just the one and because they're using a frequency within range the odds of them lying up is a very very very very slim so we're always gonna get a little bit of a wiggle in there what we are just going to do we're just going to change this size down to maybe three on the birth of them like so so this is this is all looking grand and we can move our at targets around but what if we didn't want it to be a straight line what if we wanted these to arc a little bit if we wanted them to arc we can use something called a tangent which is very similar to those little squares that you use to drag around your paths if you were drawing in Photoshop to make curvy lines a bit more curvy to use these we can head into our source and we can scroll on down and we have a source tangent by default this is going to be set to 1 0 0 if we were to change any of these values it will curve in that axis so for example if we say Z over maybe 20 we'll start to get more of a curve into the 20 points into the z axis rather all those we're going quite slow we might not be able to see this right now so I'm just going to turn off the noise Oh a sauce method of course I've left it as direct that's why we can't see so we're just going to set this to use a set and this will allow us to determine the arc so you can see here now we're getting this curving upwards and if we do it to do the exact same in our target of 20 it will go underneath so get this curvature doing under we need to also change this T is set to them so you can see now it's curving upwards and then it's coming back down again so now we don't get quite as good of a camera facing here because we're you know we're pushing it via tangent but if we were to turn a noise back on where you can still see it but now we're getting curvature upwards and a curvature downwards as you can see here we're going up and we're going down if we wanted them to both be curving upwards we would this is 20 that's why the curve isn't very high there again if we wanted the curve to be upwards just in a nice smooth arc what we would do instead of putting positive in both we would set the target to negative 50 to get the opposite effect now we get this nice curve over the top like so now we'll just head back in and we'll just turn the noise back on for our other one you can see we've got this nice art over the top and of course we can set this to a much lower value if we wanted negative 10 like so just to give it a little bit of an arc there and just separate these two beams like so now to move this around and [Music] there you go and obviously if you were to move our sphere here inside of a blueprint because our particle system has targets set up it will just always follow your target point they are everybody some some nice really easy beam lightning for you obviously if you wanted this to flash just turn off the emitter after a certain time right now we've just got it set so that it's just looping infinitely so it's just going to keep going you use a blueprint to disable it or reenable it if you wanted it to flash rapidly just use a delay to turn it on and off but there you are obviously don't make these things go too quick you don't want to give anybody you know you don't want to make anybody ill and this is why I say that I've got this sets us to be really really slow there you are have fun with that it's it's really neat little trick have a play around with your your tangents you can go ahead and you can make these tangents move around with a blueprint if you were so inclined to do so under your source tangent under distribution you would change your distribution vector constant to a distribution vector particle parameter and you could give that a name and inside of a blueprint you could pull this name out and set your vector parameter to whatever you wanted so that you could change the values here on the fly in real time so you could make it look like it was waving if you are so inclined but then you are have fun with that thank you very much for watching I'll see you all next time bye-bye
Info
Channel: Dean Ashford
Views: 27,962
Rating: undefined out of 5
Keywords: Games, Video Games, Gaming, Gamer, Lets Play, PC, Console, play, playing, player, play through, play guide, guide, game guide, dean ashford, dean, ashford, UE4, Unreal Engine, Tutorial, Teaching, Teacher, student, indie, dev, developer, development, lightning, beam, particles
Id: hjgnqkLeqf0
Channel Id: undefined
Length: 15min 20sec (920 seconds)
Published: Wed May 22 2019
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.