Welcome back.
Our slingshot goblins looking better and sounding better, but that rock needs a little work.
We need some impact effects.
Now let's find that rock.
If we look in blueprints, ability, system, enemy and go to abilities, here's where we have that
slingshot rock.
And if we take a look at class settings, we see that it's an aura projectile.
Now we have some impact variables here on the aura projectile class.
We have an impact effect and an impact sound.
So let's see what we have in our assets.
I'm going to go to content assets sounds, and here's a slingshot folder.
We have that slingshot fire, but let's go back out to Sounds and Enemies Goblin.
And here we have this rock hit.
We're going to make a sound effect for this.
So back to sounds.
Let's drag in a copy of template multi.
I'm going to need to scroll down to Goblin Rocket and we'll copy template multi into rocket copy here
and call this SFX.
Rock hit and we'll open that.
We'll get our content drawer open and dock it in layout and with our content browser with input array,
we're going to drag in that rock hit, which means we go to Sounds Enemies, Goblin Rock hit.
We'll get these three sounds, we'll drag them into that array, we'll press play.
It's a little loud.
So we're going to close the content browser, select that volume multiplier.
Let's try 0.2.
Let's try 0.15 actually.
That sounds good.
Now we can go back to Slingshot Rock and set that impact sound to our SFX Rocket.
So make sure to select it.
And there we go.
Let's see if that works.
Save all.
Press play.
Seems to be working.
Now we don't hear anything when the rock hits the ground.
And I'd like it to do something when we hit the ground.
And I think this sound effect is a little bit loud still.
So we're going to set it to 0.08, I think personal preference there.
And we are going to make sure we hear that when it hits the ground.
But before that, I want to see if we can even hear it on clients.
So we're going to go to number of players to playing is listen server and I'm going to focus on the
client window.
And I am hearing it, so that's good.
Now we're not getting the sound when it hits the ground.
So I'd like that to happen.
In fact, I don't think we get any effects when our other projectiles hit the ground either.
No, they don't.
So for that reason, really, I think what we could do is we can take the ground tiles and really,
I'm just going to select them all here in the outliner from the bottom all the way up to the first tile
with all of these selected.
Let's take a look at their collision settings.
Collision presets we can set to custom and it looks like we're blocking all including visibility here
except for projectile.
It needs to at least be overlapped for projectile and we need to generate overlap events.
Let's see what happens now.
I'm going to save all first press play.
Let's get out of the way so they miss.
And yes, we're getting those sounds when the rocks hit the ground.
Perfect.
Now, that's just one of the impact effects.
But another impact effect that I'd like to have is a visual one.
So let's see in our assets, if we have a visual effect, we're going to go to effects and combat.
And here we have combat slingshot impact.
And here's what it looks like, just a kind of little blast of slingshot rocks.
Let's see if I can get it.
There it is.
So I'm going to set that so I have slingshot impact selected.
We'll go to Slingshot Rock and we'll set that.
Let's see if we get it.
Kind of full screen.
The client.
I'm seeing it on the client.
Let's see if we get it on the server and we're getting it on the ground as well.
And that's actually a great deal more entertaining.
So I think that's looking pretty good.
Now, we might be spawning the effect multiple times.
You can kind of hear that characteristic sound when a sound is played more than once.
So I'm going to go into Aura Projectile and just make sure that we're not doing that.
So an actor or a projectile we have on Sphere Overlap and we're playing the sound.
If be hit is false, then checking for authority.
Applying the gameplay effect.
If we don't have authority, we're setting be hit to true.
Now we're using be hit to prevent ourselves from playing these effects multiple times.
So really we should be setting it to true.
If we've played the sound and spawned the system.
Right.
So I'm just going to set be hit equal to true here and we're going to make sure we set it to true everywhere.
We're spawning the effect and playing the sound.
That's also going to be in destroyed.
We'll go ahead and just set it here anyway.
Be hit equals true, even though it's about to be destroyed.
I think that will definitely prevent us from playing the sound twice and spawning the system twice.
Let's run and debug mode.
Okay, so I can click open.
Okay, so I'm going to press play here on the client.
We'll test it out.
Looks and sounds great.
And it's working on the server as well.
Okay, so now it looks like we've got combat polished up for our slingshot.
So our slingshot enemy is done.
Now we can polish up our other enemies, and we'll do those next.
Great job.
I'll see you soon.