UE4 - Tutorial - Blood Splatter! (Request)

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hi guys and welcome to another tutorial so this is a request from user nickname surname I don't think that that really is his nickname what is her name but there we are he wanted me to create a particle system for splats so I assume that he wanted them to leave decal from the floor he wasn't too descriptive but what I've gone ahead and made is a system I've just got it bound to left left mouse click right now so that he'll split some blood and then he'll leave it on the floor wherever the particles land so there we are we okay so this is what we're we're going to put together right now so you can see they work really nicely they start to glow eventually though because they have to be an emissive because this you think decal and then this is all just ensuring together now it's in my tutorial folder as you can see so what I'm going to really rapidly do is just delete everything well so I face all fast just in case because you never know how these things are going to go goodbye there we go will compile that that goes the blueprint no more bleeding and we're just going to get rid of all this but well we'll keep the splatters I need the splatters about now alright so what we're going to be using is some kind of disks which is just a sprite sheet I've joined together using splatters that I found on the internet now here you can see I've divided everything into exact squares and made sure that each sliders within a square because each one of these squares represents one frame and I believe this is at 256 here 256 256 256 different excuses so this is a 1024 texture in total let's head back in and it's just imported in in there we go so first thing we're going to do is we're going to make the particle material so material ladders underscore em open this up now we're going to set this to a we're going to leave it default it actually but we're still going to use the translucent material now reason I'm leaving this as default litters because we're not going to want this to really too low as the blood is flying out of a victim I'm going to select these splatters and now I'm going to right-click because we're going to need a particle sub UV node there we go and now we're just going to need a particle color node so we can control this Ottoman left-click and then we will combine the Alpha with the texture places into the opacity and the color into base color and now we have asked bladders lay down excuse me multiply this really quick and we shall save that dududududududududu there we go alright next we're going to make another material this is going to be these lashes underscore decal underscore m so we can open this up now we're going to go over here and in the material to name domain it changes to a deferred decal change the blend mode to translucent it has to be for a decal next we are going to give this a base color so I'm going to hold 3 for 3 vector and left-click now plug this into the base color and the opacity now I'll show you why we're going to ignore the opacity rather should do it emissive color I'll show you why I'm using emissive as well afterwards the color I'm not sure this is the right color yes that's the right color that I'm using there we are okay so that's the color [Music] now the next thing that we're going to do is we need a texture object it has to be attached a texture object for this to work on we're going to plug the flaps in there now we're going to use a sub UV function we're going to plug this into the texture which is what it needed to be a texture object because i regulate irregular link texture sample will not plug in C only works with a 2d texture object now what we're going to do is we're going to hold to and left-click for a two vector and we're going to put this into the sub images and what we're doing here is we're telling the WZ function how many frames this is made up of now if we go in here I haven't filled this I could put more I could put four more blobs in so essentially we've got is a three by four but the image itself is four by four even though we've got blank frames so we need to make sure that this is set to four four there we are and now to make sure that we can pick a particular one of these because at any one point we're only going to want one of these for our decal we're going to hold one now we're gonna hold s and let's look for a scalar put this into frame I'm going to call the we're going to call the scalar parameter frame I'm just going to leave that set to zero and then we're going to put the RGB because I don't have this with an alpha this is just an RPG black and white we're going to put that into the opacity and we should get the very first flat on the list now if I change this to one I'll get the second flat on the list there we are so you can see it three opens up there it is seconds flat sessions for that now the reason one gets the second splat is because counters always start at zero so we can't apply this and we're going to now oh yes the normal map because without a normal map these looks very quite flat on the floor so you know hold T for a texture and I'm going to use my trusty water nerve it is going to hold you you for a text coordinate and left click I'm going to set this to two on the UN movie and put this into the normal now when this gives us a very quick compile we'll be able to see so let's do some of this nice lob eNOS here it's very faint but it really makes a difference once these are on the ground I'm going to apply that and now we shall a safe now the reason that we put this into the emissive color as well is while we're using a normal map for whatever reason the decals become almost black so they weren't really visible with that image color like if I turn off the emissive color now because the translucency it's very very faint anyway you see and with the normal map added it just got darker but no no brighter in color so the color sample has to go into the emissive color as well so quickly play that now we're going to right click and make particle system we're going to call this a ladder underscore P you see a pattern I'm going to open this up and when they're required we're going to grab the ladder underscore M we don't want the decal let this load it sexy self in here it comes it's going to look weird because we're going to get every single frame at once come on you can did I not plug this in I did it's just taken forever click on file it's just really not loving me okay oh there they are in all their glory now we need to do in the required is we're going to scroll down and we're going to set emitter loops to just one we don't want this to loop infinitely so we only want to tap on one scroll down a little bit more and you'll find a sub u V we're going to change the interpolation method to random and we're going to tell it as we did before that we have four horizontal images and four vertical images okay now we're only getting one for income but we'll fix that soon so in spawn we're going to set the constant to zero because we're not going to use them we're going to go to first and inverse this we're going to add an element and in the count we're going to add ten so fling ten particles at once their lifetime we're going to set to zero zero so they're infinite about it you'll see trust me the size we're going to leave the maximum at 15 but at 25 for the minimums were changing to 15 across-the-board their initial velocity this is where it's going to start to get fun we're going to set seed 400 400 0 - 400 - 400 - 20 so we get a little bit of downfall and the spring goes quite far you can see so next up we're going to just quickly do the color of a life we're going to change this to a constant and in the our we're just going to put 0.39 red and leave the rest as is now they are good by a little particle your poor portal next we're going to right click and we're going to go to sub UV and we're going to get a sub image index now this is what's going to let us change the frame we're going to start with a 0 0 in the zero point and then in the one point we're going to go 1 and then in the nth value we're going to go 11 and that should give us frames there as frames 1 to 12 which counter wise is 0 to 11 so we'll quickly save that next we're going to right-click and we're going to give acceleration and we're going to give constant acceleration and under Zed we're going to put minus 600 so now these fall down if we quickly restart it that's where they're spawning Brittain the bounce box up so this oh no they're going away need to see where there there there so so you can see them they're falling down very very quick I mean it's quite darkened in es you might not be able to see them next we're going to give some collision after collision and we're just going to leave this set to kill and the very final thing we're going to do is we're going to right click and we are going to give event event generator and now in the event generator we need to give it an event the type we're going to fix collision and I'm just going to give this a custom name of splat ok this will let us create a custom event in a blueprint later on using this particle system so that's the particles sorted now if you decide you want these to move a little bit quicker or a little bit slower that's perfectly fine you can change the velocities and the confident acceleration to whatever you need that this is just the example that I'm giving so we've made all the stuff that we need to actually get this to look right so what we're going to do now is we're going to work on a blueprint so we can open up the level blueprint and I'm going to right click and on mouse left or just left mouse button I always forget the exact wording but sometimes you can just kind of wing it and it works Q so on a click spawn emitter at location I'm going to go back to the level I'm going to get the guy I'm going to create a reference to him and from him I'm going to get mesh and I'm going to quickly go into the emitter here and I'm going to set this to our splat splat Appy I see the letter P you know I know we're not spawning a meadow at location - steak that's what we're doing with the decals afterwards we're attaching tap spawn emitter attached there we are now plug the mesh into the component set the template here to the splatter I'm getting ahead of myself where is ready to spawn some decals now this will spawn them directly on the floor so we're just going to raise this up so instead we're going to put 150 in the location and this will make sure that they spawn quite high so if we quickly go into the level if we left click we we all know he's flying from his neck okay so that's working you can open the level blueprint again next we are going to drag out from the return value and goo goo goo goo we're going to bind event on car nickel collide you can see here bind event on particle collide and we'll get this really nice note here this has to can either return value here okay now put this in now we're going to do is from event here we're going to click and drag and we're going to type custom event and we can add a custom event and that will link these together so basically now whenever this fires it will make sure that this happens we're going to call this on collide event now what we're going to do is this is we're going to drag out of here we're going to create dynamic material instance we're going to set this to our bladder decal underscore M from the return value set scalar parameter value parameter name I believe we call it free now what we need to do is we want to get a random integer now you can use a floating range but I prefer to use an integer because we're going to get a whole number we can set the max to 11 we're going to plug this into the value and it will automatically convert this from int to float so you don't have to worry about that it will do that on its own and from here we're going to spawn decal at locations the decal material we're actually going to drag from the create dynamic material instance and plug this in so next from the on collide event dragged from location and place this into the location from normal we're going to drag out and what we're going to do is we're going to rotation from X vector we're going to put this in now what this does is it's going to check the X vector of any objects normal so a normal is a point it's an invisible point that you can't see that's pointing outwards from an object that determines which way a face is facing so which axis of face is facing towards or away from so this is going to get that and then it's going to rotate spawn to decal based on the object that it hit so it's going to check the normal of the object it hits and then it's going to say ok the objects facing this way this means that the part of the decal has to face this way and we'll do that for you so now we need to give these a lifespan I'm going to go in my life span of 20 and in decal size I'm going to random float I don't want just random float I want a random float in range and I'm going to say between 20 and 50 I'm just going to plug this strange decal size and I will convert the photo vector so we get exactly the same number on all three axes there and now that should he says optimistically be working so if we click there we are now when our articles hit the floor it's borne some decals yeah so there we have it now you know probably not going to want this bound to a to a left-click which is what I've done here this is just for the example so just change the left-click to any event that you want in which the player will bleed so so you've got a trap that player touches a trap so on collide with trap layer blood so there we have it spartacus particles here since particle I need to sleep some particles that spawned from the player that you can put based on hit and when they hit the floor export some decals so I hope that that's helpful for you guys and that some of you guys can use this you can see the normals on the on the splatters on the floor they're nice I mean nice look at that yeah oh baby so that so there you have it good I hope this is useful for you this as I say was a request video so if anybody does have a request please just get in touch because I'm happy to do this I find it fun so I'll see you guys next time
Info
Channel: Dean Ashford
Views: 62,300
Rating: undefined out of 5
Keywords: UE4, Tutorial, unreal, Engine, Unreal Engine, Student, Indie, Developer, Dev, Games, Blood, Particle, Effect, Decal, Spawn
Id: kLeKe2SHu78
Channel Id: undefined
Length: 18min 53sec (1133 seconds)
Published: Mon Feb 06 2017
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.