♪♪♪
(Wes Bunn) All right, so we are back. In the previous video, we added some simple Collision
Sphere Components around our Character's hands so that we can interact with our environment
when we punch. So we can punch things and knock them around things that are physics
objects, which is pretty fun. This video is a little bit of an extra credit project. We have
kind of already worked with Animation Notifies, but I wanted to work with them again
to kind of show you how you can create a particle effect while the Character is running around
to kick up some dust. You could also use this as a way to queue sound effects for like footsteps
when the Character is walking, etc. So I kind of wanted to take this video to take a stab
at doing that. So, let's continue inside of our project here. Let's hop down to the Content
Browser. Make sure that you are under the Character > Animations folder. Let's go to
the ThirdPersonRun (Animation Sequence). So go ahead and Double-click to open that up
in Persona. Again, we are on the Animation tab of Persona. This is where we will be doing
our Notifies in this window here in the center. So what we want to do... I am going to Pause
playback here really quickly. Let's move our Character so that we can get a better view of him.
What we want to do is add a Notify essentially when our Character's foot hits
the ground. So somewhere around there, we will add a Notify Event to play a particle
effect. We will do the same thing when his other foot hits the ground as well. It is
pretty easy to do inside Persona here. So all we need to do is drag this Timeline here
somewhere to around I would say the 7th frame, something like this. It looks like his foot
is going to hit the ground right about there. Then up in this Notifies section up here,
we can Right-click and choose Add Notify. Now, we have some other options in here: we
have IsPunching1 and IsPunching2. We created those in a previous video and we also used
the New Notify. But at the very top, we have PlayParticleEffect and PlaySound, which are
pretty standard if you just want to play a sound or a particle effect as a Notify Event. Select the PlayParticleEfffect
and that is going to add it. If we click on it now, inside the Details panel you will
see we have the opportunity to define what the particle effect is going to be. We can
do that inside the drop down here. Now because we included Starter Content with this project,
we have some Particle Systems to play with. So we are going to start out (just to make
sure that we get things working) by using this P_Explosion. So go ahead and select that
from that drop down. There is one other option that I wanted to talk about really quickly.
There is this Attached option. Now, you can see the tooltip for it says, "Should attach
to the bone/socket". Essentially what this means is as we get to this Event, you see
that the particle effect plays. As we get to this Event, we are going to continue moving
in game. So if we leave this checked, what is actually going to happen is that this particle
effect will follow us as we move around. So for right now, we are going to leave this
checked to kind of illustrate that when we get into the editor and test this here in
a moment. But let's add our other particle effect to the other foot. So go ahead and
drag the Timeline on a little bit more somewhere around the 15th frame or 16th frame? Somewhere
around here. It looks like we are at about the 16th frame. So go ahead and Right-click
in the Notifies section again, Add Notify, and PlayParticleEffect. Click the particle
effect and then in the Details panel in the upper right, assign a Particle System to use.
So click the drop down, and select P_Explosion. Now what we are going to do is you see there
is an option too that says Socket Name? We can define where want to attach this particle
effect. The Socket Name that we can reference can be a bone name too, as you see it says here.
We can use our Skeleton Tree to get the name of the bone that we want to attach it to.
So for our example, we want to attach it to the foot. So let's scroll down a little bit
and let's find our feet inside of our Skeleton Tree here. It should be down near the bottom.
There we go. So we have foot_l, which is our left foot and we have ball_l. So if we look
at foot_l and go into the viewport here, kind of up at the ankle is where that is. But if
we pick ball_l, you can see it is kind of around the toes. I think that is a better
place to attach it rather than at the ankle. So we are going to use ball_l and ball_r for
our two sockets. So let's click on the first particle effect here (in the Notifies section).
This should be our right foot, right? Yeah, so let's go ahead and use the "ball_r" for our
Bone Name here. So we are just going to type in ball_r. Not Caps: ball. You can see it
actually populates for you with relevant names from our Skeleton, so go ahead and select
ball_l. Which it didn't work for some reason; that might be a new feature that hasn't been
fully implemented yet. Hopefully by the time you are watching this, that has been addressed
and you can select it from here. It didn't seem to catch. Let's try it again on the other
particle effect. So let's select the other particle effect and we will use ball_r.
Actually, this should be "ball_r", that should be "r", not "l" for this one. So "ball_r"
and then on the other one, we are going to use "ball_l". So let's try that again; "ball_l".
I guess you have to make sure that it is highlighted. Yeah, you have to make sure that it is highlighted.
So that is user error, not Engine error there. (Laughter) So we have attached to the socket.
Technically, this will work for us right now. So we can actually Save up here in the upper
left and test it out. So let's hop back to the Level Editor here and let's Play in the
editor. Now as we are running around, you should see (boom!) we are running around and
have exploding feet. That looks pretty cool. Notice that they are attached to us, so let's
try that again without attaching them to see what kind of effect we get. So let's hit Esc
and go back to our Skeleton up here. Let's select the first particle effect there and
uncheck Attached. Do the same thing for the other particle effect as well. So there we go.
Let's Save again. Let's Play and see what that looks like now. So now as we run around,
it is still kind of attached to our feet a little bit, but you can see that the smoke
follows us. We will be able to demonstrate this a little bit better when we create our
own particle system here really quickly. But you can see there is a trail of smoke following
now that we leave behind, which is cool. So with that let's actually create our own particle
system here. Now a bit of a warning; I am not going to go too in depth into Cascade,
which is the Particle System Editor inside Unreal Engine 4 because there is a lot involved
in that. But I did want to create a particle system really quickly so that we can have
a little bit better of an effect. If you would like to learn about particle systems, you
can go to our Documentation under docs.unrealengine.com. It will take you to the main Documentation
page. Under Engine Features > Graphics, there is a whole section on Particle Systems: the
ins and outs, key concepts, etc. Feel free to come here and read up on particle systems
a little bit later if you would like. So let's create our particle system now. Again, this
is going to be pretty basic. Since we are using starter content, there is really no
need to re-invent the wheel. So we are going to borrow one of the existing particle systems.
So down in the Content Browser under the Starter Content folder, let's make use of our starter
content. Let's go to the Particles folder. So go ahead and open that up. Now there are
a bunch of different options in here that we could use. There is our P_Explosion that
we are currently using. But we are going to use this P_Steam_Lit. We are going to make
some modifications to this. So Right-click on it and select Duplicate from the context
menu. Let's give this a new name. We are going to call this "P_Dust", like so. Then go ahead
and Double-click to open it up. Mine kind of popped off-screen here, so I am just going
to bring that in so that we can see it. I am also going to maximize it because we are
going to be inside here for a moment. So we are inside Cascade now, which is the Particle
Editor inside Unreal Engine 4. There are all kinds of different things in here that we
could be talking about, but we are going to save that for another video series. We are
kind of going to take this as a do-as-I'm-doing type of learning session here. So let's
continue. Let's make our basic particle system here. The first thing that we are going to
do is make sure that we have nothing selected. Currently, this is where all of the emitters
will be for our particle system. We only have the one, but we are going to make sure nothing
is selected so we are going to click off into this empty space here. We want to hop down
to the Details panel and we want to make a couple quick changes here. So first of all, we
have this Warmup Time. The time for the particle system to warmup, as the name suggests here.
It is currently set to 7; we are going to zero this out actually. We want to make this
0 because we want 0 Warmup Time. So go ahead and zero that out. Hit Enter. For the other
changes we want to make, we are going to hop up to the emitter itself. Click the Spawn
module so that we make changes to how it spawns. The first thing that we are going to go to is our
Rate > Distribution. Now yours may not have been expanded. Go ahead and expand this Rate
option and Distribution. Then for Constant, it is currently set to 2. Let's zero this
out as well, like so. Then, we also want to uncheck Process Spawn Rate. Now our particle
system is going to disappear in our viewport here. But we are going to make some changes
to our Burst because we want this particle effect to burst instead of just spawning in.
Go ahead and click the plus sign (+) next to the Burst List option here. That is going
to add an element for us and give us some settings to adjust. Currently, the count is
set to 0; we want to change this to something like, I don't know, let's say 10. So just
spawn in 10 particles, like so. I think that is good. Then, also we want to... Let's see.
Let's scroll down, scroll up. I think we are done in here for the moment. I don't think
we need to make any other changes in here. Let's actually go to the Required module.
So go ahead and click the Required module. There we go. The first thing that we are going
to check is Kill on Completed. We want to destroy this emitter when it is done, so go
ahead and check the Kill on Completed checkbox there. It will continue spawning in here over
and over again; this is just because this is the Preview window. So that is why we are seeing that.
Then also under the Duration section, I think Emitter Duration is fine
for 1 second. But let's scroll down a little bit and let's go to Emitter Loops. Let's go
ahead and just change this to 1. It is currently set to 0. So that will give us one puff of
smoke and that is it. Let's hop up to our Lifetime module now. So let's go over to the
Lifetime section here; go ahead and click that. Let's expand Lifetime and expand Distribution.
The Min and Max are currently set to 5 and 7. That is pretty high. Let's go to about,
I don't know, 3 and 5. That is still kind of long, so let's actually bump that down
a little bit more. Let's try 1 and 2. So it kind of just pops in and then pops out. So
it is really short. That looks like a little bit of a cloud of smoke, but it is pretty
big. We don't want that big of a dust effect. Also, we want to change the color of it because
it is currently kind of white. So let's change that. Let's go to our Color Over Life section
here. Our Color Over Life module, so go ahead and click that. We are going to expand Color
Over Life > Color Distribution. The Constants are currently set to 1, 1, and 1. Let's change
these up. Let's change the Green to 0.7, so now it is purple. Let's change the Blue to,
I don't know, 0.5. There we go; it is looking a little bit more like...dirty? I guess that
is the word I want to use here. Dusty? There we go. Let's hop down to the Alpha Over Life,
so we can change some of the settings here as well. Actually to change this, let's go
over to the Color Over Life module. Let's click this little curvy line over here. Go ahead
and click this. That is going to add our Color Over Life keyframes here that we can change. Let's try and grab...
Let's try and grab... Is it this one that we want? Let's see; let's move that up just
a little bit. No, we don't want that. That is not the one we want. Let's hold Ctrl + Z
to get back. Let's use this one. I think this is the one that we want. Let's pull this
down a little bit, somewhere around here. Let's pull this one down just a little bit too.
Something so it kind of evens out, like so. So, it is not as high coming in and it kind
of trails off. I think this is good enough. Again, you can kind of play with these curves
however you would like to get the effect that you want. But it is just going to come in,
you are going to see it appear, and then it is going to disappear over time really quickly.
So we are also going to add some other effects to this. Actually, let's do that now. Drag
is already here, so let's make some changes to Drag. So let's expand the Drag coefficient.
Its Constant is currently set to 0.8. Let's bump that up. Let's bump that to say 5. So
there we go. That looks kind of cool. Not too bad. I think we do need to change our
Size still, so let's hop over to our Initial Velocity. So we are going to go to the Initial
Velocity module. Let's change our Start Velocity. Expand Distribution; we are currently set
to 32 Max and 16 Min. Let's try 100 for the Max X and 100 for the Max Y. Leave the Z at
50. We are currently kind of expanding upwards. We want to go more outwards. So we are going
to make some changes here to do that. Let's change the Min as well. That's why we are
leaving the Z at 50. Changing the X and Y will expand it outwards. So let's try for
the Min, let's say -100 for the X and -100 for the Y, like so. Something like that. I
think that is good. We need to make one more change to our initial Size now. Our Start
Size and Distribution. The same with the Max settings here, let's change these. Let's try
for the Max 75 and for the Min, let's try 50. Here it is. It is a little bit tinier
now. I think that is good. That is good enough for now. Let's try this out actually.
Let's Save and let's close this particle effect. Now with the particle effect (P_Dust) still
selected here and our Skeleton tab still open, let's actually hop to our Skeleton tab now.
Well, we are still in Persona. Make sure you are on the Animation tab. Click your particle
effects now. In the Details panel for your particle effect we can click this arrow because
we are going to use the selected asset from the Content Browser, which is our P_Dust effect
there. So go ahead and click the arrow here. It should assign it; you can see,
which it does. Now let's do the same thing for the other one, like so. Let's check that and
see what that looks like. That looks a little bit better. Again it is playing right there
because we are not moving, but once we get in game it should not be attached and you
will see it kind of trailing behind the PlayerCharacter. So let's test that out. Let's actually Play
and see what it looks like. Let's Play in the editor here and let's run around. So there
we go; kicking up a little bit of dust there as we are running around. Obviously it could
be a little bit better, but it kind of shows you how you can do it. Again, you can add sound effects
to this for footsteps if you would like using those Notifies. But I think that is good.
I think we can wrap here. What we have done is created a particle system and used Animation
Notifies to play that particle system during certain points inside of our animation using Persona.
That is going to wrap this video up. I hope you guys enjoyed it. Thank you so much for
tuning in and we will see you next time.
♪♪♪