‫Hello and welcome.
‫In this lecture, we're going to be adding an impact particle effect to wherever we hit with our rifle.
‫So let's dive in and see how it's done.
‫So this is going to be a quick one because we want to do something that we've already done before,
‫which is spawn particle effects that aren't attached.
‫Now we know that this is going to be using the new gameplay statics again, and let's go ahead and open
‫up that header file.
‫So gameplay static H and we want to search for the spawn emitter within here.
‫The symbol search isn't always reliable, so I'm going to just do a search spawn emitter.
‫And we are looking for the other versions of this spawn emitter at location.
‫That's the one we want.
‫And what we're going to do is it's going to need the world, the particle system, a location and a
‫rotation.
‫You could go with a zero rotation, but we actually want a rotation.
‫So let's go over to the game, to the gun, C++, rather.
‫And we're going to use this spawn emitter at location to a get world.
‫In here, and then we are going to give it a particle system.
‫So we need to go ahead and set one up.
‫I'm going to leave that blank as a to do for you, seeing as we already know how to set up particle
‫systems and then what we're going to do, we're going to get the location that's fairly straightforward.
‫That's going to be the hit location, isn't it?
‫And then the next thing, let me get my spacing right there.
‫Then the next thing is going to be the rotation.
‫Now this is slightly more complicated.
‫Now the first thing we're going to do is we're going to create a vector for the shot direction, which
‫is going to show us where the shot was coming from.
‫And this one is fairly straightforward because we've already got the direction it's going in.
‫So where it's coming from is just going to be the negative of this.
‫So minus rotation vector is going to give us the shot direction.
‫Where was that shot coming from?
‫And that's going to be useful when we're applying damage later as well.
‫So shot direction.
‫Cool.
‫Great.
‫And what we want in here is a rotator.
‫So you can get a rotator from a vector in C++ just by doing dot rotation like so.
‫And that should be enough so we can put a semicolon on the end of the line.
‫So all that remains is a mini challenge for you to fill out this particle system with something that
‫we can configure in Blueprint.
‫Okay.
‫Welcome back.
‫So we're going to essentially do what we did with the muzzle flash.
‫So I'm going to copy that.
‫You property here instead of the muzzle flash, we're going to have the impact effect.
‫Like so and we're going to use that in your gameplay.
‫Static spawn emitter at location.
‫Cool.
‫We're going to remove the draw debug point and we're going to have a go at compiling and playing.
‫Once you've got that to compile successfully, we are going to go over to the content browser, open
‫up our BP rifle because we need to attach a impact effect.
‫Let's open up the full blueprint editor.
‫Go to class defaults.
‫Details impact effect.
‫Let's look.
‫See what we can find.
‫Impact.
‫See if we've got something.
‫There I am.
‫Nope.
‫No, I am either.
‫Maybe it's going to be called hit logo.
‫We've got a Dre Wraith drone hit world.
‫We've got a few different things down here and I think we can also choose some stuff from the shooter
‫game asset pack.
‫So if we go back to the content browser, asset packs, shooter game weapons, not weapons, sorry,
‫the effects and then particle systems and then weapons, assault rifle impacts, who got the eye impact
‫hit or something.
‫So we can I think I'm going to be using that one.
‫So I see what I'm going to search for assault rifle.
‫That will be my impact effect.
‫I quite liked that one in testing.
‫So we're going to go alt p, but you can try out the other impact effects and try and hit a wall.
‫There you go.
‫When I hit the wall, you can see the impact effect being spawned off of it.
‫So I'm very happy with that result.
‫And the next lecture, we're going to be dealing damage to actors that we place around the world.
‫Very exciting.
‫So I will see you there.