Welcome back.
So we're almost done polishing up our goblin spear.
Although when we hit the spear goblin, we're causing it to hit React.
But we don't have any sound effects for that.
And we don't have sound effects when we kill the Goblin.
So we're going to implement those in this video, which should be fairly quick.
I'm going to go into assets, enemies, goblin animations, spear and go into my hit React.
And I think we could use a sound effect here.
So let's see what sound effects we have in assets sounds.
We're going to go to Enemies Goblin and we have one called Hurt, and we have these three sounds, and
I'd like to make a sound effect with that.
So I'm going to go back to Sounds and copy the SFX template multi into Goblin Hurt Copy here and we'll
just rename this SFX.
Goblin hurt.
And I'm going to open it up, open the content drawer, make sure it's open to Goblin hurt doc and layout.
So I have these three, get my input array and bring those sound waves into it.
And I know I'm going to want this to be a little quieter, so I'm going to take that volume multiplier,
try 0.25 and it looks like I might have dragged in the wrong sounds.
Yeah, I dragged in the swipe sound, so I'm going to hit the trashcan and go back to my content browser
tab and make sure I go to enemies Goblin hurt and get those sounds.
That's the one.
We'll get those.
Press play and that looks pretty good.
Now with this selected SFX Goblin Hurt, I'll go into my hit React and we'll go ahead and just add a
sound.
I'm going to I'm going to rename this notify track to sounds, right, click add, notify play sound.
And there it is.
Let's see how this looks and sounds.
By pressing play.
Perfect.
Now we can give this a little bit more random variation on our pitch as minimum is zero.
Max is 1.25.
We can go to like negative two to positive two.
And if we wanted even more, we can go to negative three and positive three.
We just have to be careful.
We don't want too large a variation and let's see how that looks.
I actually like it a little higher.
So I think what I'll do is go from zero to probably positive four or so.
And testing it out.
And we don't get a sound when it dies.
Just when it gets hit.
Perfect.
Now I'd like a death sound.
Now, this will be a little different because we're not actually playing a montage for death, so we're
going to need a variable for a death sound, and we can put that on the base character class.
So I'm going to save all.
We're going to let's close all tabs and just go to the public folder character or a character base and
we'll put a sound and this will be for the death sound.
So let's make a new sound base.
That's a pointer.
We'll call this death sound.
I'm going to give it the same new property specifier as Blood effect.
And we're going to want to play the death sound on death.
And that can be in multicast handle death.
So I'm going to find that.
Multicast handle death and we're going to play a sound at location.
I'm just going to put it right here at the top and this will be using you gameplay statics.
So alt enter will get my include for that and we'll use play sound at location and pass in all the parameters.
This for the world context object death sound for the sound location get actor location rotation get
actor rotation.
The rest of these can be left out.
And there we go.
Now we just need a sound effect to play.
Let's go ahead and compile and launch.
Okay.
So back in the editor we have Goblin hurt.
We're going to want a Goblin death sound as well.
I think I can close project settings and let's go to Goblin and asset sounds enemies and here's a death.
So I'm going to want a sound effect for this.
So let's copy sound effects template multi into Goblin death copy.
Here, rename this to SFX Goblin Death.
We'll open it.
Will open the content drawer, dock and layout and make sure we're in sounds.
Enemies Goblin death.
We'll get these three.
We'll select our input array, drag these three sounds into it.
Close the content browser.
Take our volume multiplier.
I'm going to set it down to about 0.25.
Let's see how it sounds.
I might bring that down to 0.15 for the volume multiplier.
Looks good.
Sounds good, I should say.
And let's set this on the goblin.
So we're going to go to Content Blueprints, Character Goblin Sphere.
Let's open that blueprint, Search for Death Sound and we'll set this to SFX Goblin Death.
Now we can test this out.
Let's go ahead and kill the goblin.
Poor little guy.
All right.
Now it's a little bit harder to hear on top of auras.
Exploding fireballs.
But that's okay because soon we're going to be causing death on a massive scale for these little guys,
which means there will be a lot of those death sounds.
And I don't want them all to be overwhelming.
So I'm okay with it being a little bit more quiet.
Excellent.
All right.
So now we've basically polished up combat for our little goblin spear guy, and we've also set up a
pretty good framework that we can use for our other enemies when it comes to effects.
So now we just need to do some polishes for our other enemies, and we'll do that in the videos to come.
So great job.
I'll see you soon.