Welcome back.
Now we have a melee attack, but we could easily make a ranged attacker for our demon.
And I'd like to do that in this video.
Now we have a demon throw, and it's pretty simple.
Just a little throw animation.
We're going to make a montage out of this.
But first, we need to check enable root motion on it.
We'll save and we'll go ahead and right click, create and a montage, and we'll call this aim demon
throw.
And just like with our other montages, we just need to add a couple things, right?
We want a motion warping notify track.
So a motion warping.
And I'll just really quickly add another one called Sounds and we'll just use these two.
So for motion warping, I'm going to add a notify state motion warping.
We'll go to about here, change this to facing target, uncheck warp translation rotation type to facing
and we're going to send an event right about here and this is going to be closer to our ranged attackers
for the goblin are arranged slingshot attackers.
Right.
The only difference is we don't have a weapon, but we are going to send an event.
So add, notify, montage, event.
And for the event tag, we're going to make this montage attack one.
And that's because I'd like this to be a different demon class.
We'll have a demon that's a warrior and a demon.
That's not a warrior.
It's a ranger.
So for that reason, the Ranger is just going to have the one attack.
So we have montage attack one.
And finally, we can place a sort of swiping sound for this as well.
So let's go ahead and add a notify play sound and we'll just use Swipe.
That's fine.
And actually, I'm going to go to swipe.
I'm going to duplicate it and make a swipe.
Quiet.
So swipe, underscore.
Quiet.
And I'm going to change the volume multiplier to 0.1 and change the pitch to go to a minimum of negative
three and we'll use that.
So back to the demon throw.
We'll change this to swipe quiet.
Cool.
All right.
So we have a demon ranged attack now.
Now, this is going to be somewhat different because we're going to have a demon that has a melee attack.
That's this demon.
We should rename it to Demon Melee or Demon Warrior.
And then we'll have another demon that will be a demon ranger.
So I'm going to rename this demon to Demon Warrior, and this will have the character class warrior.
But I'm also going to right click on it and duplicate it and have a demon ranger.
And this one will be different.
This demon is going to have a different character class.
So we're going to set character class to Ranger and we're going to search for attack and remove its
attack montages.
I'm going to hit the trash can and just add one.
And this will have the montage and demon throw.
The montage tag is going to be one because we set it to one and the socket tag can be different.
This can be a hand socket.
It needs to be our left hand right.
So let's make sure that our demon has a left hand socket.
We're going to go down to wrist L That's right there.
And we're going to right click.
We're going to add a socket and we're going to call this.
Left hand socket.
We're going to copy that name and I'm going to hit W so I can move the socket just to the right spot
there, right about there.
And go back to my demon.
Beep demon ranger.
And we're going to set the socket tag to left hand.
And I'm going to search for left hand socket name and set that we need this set to left hand socket.
And because this is a ranger, it's going to be given the ranged attack.
Let's just really quickly go to that ability.
Content, blueprints, ability, system, enemy abilities, and we'll open our ranged attack.
Now, what do we do when we receive the event?
We get the combat socket location and we spawn a projectile.
And what is the projectile that we spawn?
Well, in a ranged attack, it's projectile class and it's hardcoded to slingshot rock.
So really, if this is a ranger, we should be getting the correct projectile, right?
Unless we don't mind that our range attackers all just shoot rocks because as it stands, we're going
to be throwing rocks, which actually is kind of cool.
Let's see if it works.
I'm going to remove this demon because this is a demon warrior.
I'm going to delete that and go to blueprints.
Character Demon, and we're going to bring in a demon ranger instead.
Let's see what happens if we press play.
First, I'm going to save all and then press play.
Okay.
So it actually looks like our enemy is getting a collision most likely with itself.
We can tell for sure since we're running in debug mode by placing a breakpoint in that aura projectile.
And on overlap we can check the other component, the other actor and so on.
So I'm going to place a breakpoint there.
And press play.
And see what the other actor is.
And it looks like the other actor is static mesh actor 26 It's the tile.
So I'm going to remove that breakpoint and continue.
And let's see why we're getting that.
It looks like we're not spawning at the correct location.
So I'm going to go to my ranged attack.
And I see here in my ranged attack we're calling Spawn projectile.
We're not actually using this socket location at all.
And if we go into our ability system abilities folder and into Aura projectile spell, we're getting
the socket location here and it looks like we're always getting combat socket weapon.
So it seems like this ability should take in a gameplay tag for this for the combat socket.
Otherwise it's just going to spawn at combat socket weapon, which is not going to work when we're spawning
it from the hand, right?
So we're going to need to fix that.
So I'm going to go ahead and close out of the editor and we're going to change Spawn Projectile so it
takes in a gameplay tag for the socket.
So I'm going to open up Aura projectile spell H, go into spawn projectile and add a second input parameter
and it will be a const F gameplay tag reference and we'll call this socket tag.
Now this is a reference so we can forward declare the gameplay tag without having to include gameplay
tag container.
So we'll forward declare the struct f gameplay tag.
And we'll add this as an input to spawn projectile and we'll pass socket tag in to get combat socket
location instead of hard coding in the weapon this time.
Now that means we'll have to change this in a couple of spots, right?
So let's compile and we'll launch and fix where it broke.
So we'll go ahead and get that ability open again.
I don't think we need too many of these other tabs open, but for now, I'm going to go ahead and close
daemon throw and back in the range attack.
We need to pass in a socket tag, right?
Well, we have that socket tag and I'm going to grab it here from break tag montage, reroute it.
And we'll bring it all the way over here.
And pass it into spawn projectile.
Okay, so that's looking good.
We also realized we're not using this jet combat socket location.
We can remove that altogether.
And I just messed up.
This should be event received, so got to be careful which wires we hook up.
So with that, let's test this out.
Oh, and of course we have a blueprint error in Firebolt.
Let's go to that.
And the reason that we have an error is because we need to pass in that socket tag for spawn projectile
as well.
And here for Firebolt, it's okay if we pass in a hardcoded tag.
So we're going to drag off of socket tag, we're going to make a literal gameplay tag and set it to
combat socket weapon.
So we were hard coding it in C plus plus before because that's what aura uses.
Well, Firebolt is for aura, so we're going to use weapon there.
And with that, let's go ahead and press play.
Aura still works and now our.
Demon is throwing rocks.
How rude.
And it's working.
So we have a ranger demon as well.
Which is really cool.
And if we really wanted to, we could change the material for our Ranger because, well, we have a
dark material.
So if I go to Demon Ranger and select the mesh and scroll down, we have Demon red.
But if I click the dropdown, we have Demon Dark as well.
And here's what it looks like.
Pretty cool.
So this could be what our ranger demons look like.
They're darker.
A little bit more serious, right?
Pretty awesome.
And if we want to see what both demons look like together, we can go to Character demon and bring in
the Demon Warrior, maybe two of them, and press play.
And we have two of the roundhouse demons and one throwing rocks.
All right.
So we're one step closer to having our demon character.
We still have some other things to polish up, and we'll do those next.
I'll see you soon.