Welcome back.
It's time to make our demon attack montage.
Now the thing is, we can make a melee attack with our tail swipe or we can make a ranged attack.
So why not both?
Let's start with a melee attack.
We're going to go into the animations folder and we have an attack L and attack R so we can have two,
much like our ghoul has a left and right attack.
So here's our left attack.
I'm going to right click on it.
Go to create create anim montage and call this Am attack demon L.
So here's our attack montage.
Now notice that the demon ends up facing the side, and that's because that's how this animation was
made and because it's a root motion animation, it's not going to spin all the way around because that
attack L has a key baked into it.
So it looks this way in the montage, but we'll see how it looks when we actually play it in the game.
So we have a montage and we need a couple of things here.
For one, we need to use motion warping.
In fact, let's take a look at one of our other enemies attack montages.
Let's go to Goblin.
Let's go to animations Spear, and we'll take a look at the goblin attack.
So we have a couple things we need a motion warping notify State and we need to send a montage event
and perhaps some sounds.
Right.
So let's start with motion warping.
So here in the demon attack, we'll rename the first track to motion warping.
Right click add, notify state motion warping.
I'm going to select the right handle hold shift and I'd like to motion warp our rotation up to about
here.
So we're facing our motion warping target right about there and then our demon will continue through
with that swing.
Now we need to select the root motion modifier change, warp target name to facing target, uncheck
warp translation and set rotation type to facing.
And there's our motion warping notify state.
Next we need to send a gameplay event.
So right about here I'm going to right click and add a notify using a montage event.
And this is where we specify the montage tag.
So we're going to take our event tag and use Montage Attack one and that will be for our left attack.
Now aside from that, really all we need to do is add a sort of swoosh sound.
So I'm going to add a new notify track.
I'm going to call it sounds right, click add a notify play sound and let's see if we can use that swoosh
again.
That's actually one.
That sounds kind of like a weapon swoosh, isn't it?
But if we go to the Google into the swipe, I think that one sounds a little better.
I'll change it to that.
Yeah, that sounds pretty good.
And now we just need to make sure that our enemy is triggering this event at the correct space so that
it actually hits our character.
Now, before we test it out, though, we need to add tagged montages to our Demons attack array.
And so far we only have one.
So I'm going to go to the Demon search for attack, click plus to the attack montages, and we'll select
our new demon attack Demon L.
The montage tag is Attack one.
Now the socket tag, this is kind of new, right?
Because it's not really the left hand socket or the right hand socket.
But if you'll recall, we set our weapon type socket name to the tail, but that's not going to really
work, is it?
Because if we use the weapon, then it's going to try to get our weapon.
If we go into a character based CP and we search for combat socket location, we'll see here that if
that montage tag is combat socket weapon, it's going to try to get the socket location from the actual
weapon and our demon doesn't have that.
So really in this case, we're going to need another type of socket tag.
We're going to need a tail socket, right?
So we can add that type of gameplay tag.
Let's go ahead and close and save all and we'll go into our aura gameplay tags.
Dot h and we'll add a new type of combat socket instead of weapon, right hand, left hand.
We're going to have combat socket tail.
Now we can accommodate for tail creatures.
And we'll go into our gameplay tags, dot CPP and we'll create this native gameplay tag here.
So it's going to be combat socket underscore tail.
And for the F name it'll be combat socket dot tail and the F string can just say tail.
So now that we have this kind of socket, that's what we're going to use.
Now we have to go into our character base and to get combat socket location and we have to accommodate
for the tail socket, which means we should have a tail socket name.
Now this is kind of unique to tailed creatures, but I don't really feel like making a subclass of our
character specifically for tail creatures.
So we're just going to have this on our character base.
So right here with our other socket names, we're going to have a tail socket name as well.
So this name, tail socket name.
Now we have that and we can check.
So we're going to add another if statement here and if the number of different types of sockets grew
considerably, then we would start thinking about a different solution to this.
But in the case where we only have four and I don't foresee very many more, even though I said that
before, I think that this solution is fine.
So we're checking combat socket, underscore tail and we're going to get the socket location using our
tail socket name.
So with that we can compile and we'll set that tail socket name for our daemon.
All right, clicking open.
We can go back to Daemon and I'm going to search for tail socket name.
Here it is.
And instead of using the weapon type socket name, I'm going to now use tail socket name.
And that's now set to tail socket.
And I set that weapon tip socket name to none.
So now we'll be using the tail socket.
So if we search for attack, we can now set the socket tag to combat socket dot tail and we can use
an impact sound.
Let's just take a look at what our goblin impact sound is.
So we'll go to Goblin Spear.
Search for attack.
And it looks like it's using swipe.
And I think that's what we're using in our attack montage.
So I think what I'll do is take my demon attack and instead let's set it to ghoul attack.
Yeah, that sounds better.
And then we'll use that swipe sound right here for the impact swipe.
And you could duplicate these and change their pitch and make them sound different if you like.
So that's our demon L.
We also need the demon R So I'm going to browse to my attack demon.
L I'm going to right click on my demon attack.
R Create an anim montage call this am underscore attack demon.
Ah, open that up.
And same deal.
We'll call the first notify track motion warping and we'll give this a notify state motion warping.
And set the parameters.
Warp Target name is facing Target.
Uncheck warp translation rotation type facing.
There we go.
Let's add that event.
I'll add a new notify track.
Actually, I'll just have to like the other one.
This one will be sounds and I'll have my event on the same track as the motion warping, add, notify
and montage event.
And for this the event tag is going to be montage attack to the left was attack one.
This will be attack two.
That way we can tell between the two in our attack gameplay ability and we can just add that swipe.
I'm going to just double click on my other attack.
Select this one, Ctrl C, come back.
Click here Ctrl V and there's our Ghoul attack sound.
And it looks and sounds great.
Now we can go back to Demon, add a new attack montage.
We'll set the montage to attack Demon R, set the montage tag to attack to set the socket tag to the
tail and set the impact sound to the same SFX swipe.
And now we have two attacks.
Okay, so what's left is to test this.
I'm going to save all.
And before we test, I'd like to go to my melee attack in Blueprint's ability system, enemy abilities
G a melee attack.
And as soon as we get live players within radius, I want to draw a debug sphere.
It'd be nice if I just had a check box right here for get live players within radius for drawing a debug
sphere, but I'm going to draw a debug sphere right here because I want to make sure that throughout
all that spinning and everything that the attack is positioned correctly.
So draw debug sphere.
I'm going to draw it at the same radius.
And this should probably be a parameter on the melee attack, but that's okay.
I'll hardcode 45.
We're going to use the combat socket location for the center.
I'm going to draw it for five seconds.
And the line color can be red.
So now we can test out our demon.
So I'm going to drag in one of our demons.
Actually, before I do that, I want to set my demons character class to warrior.
And I see that it already is.
All right, let's get it in here.
I'm going to browse to it.
Drag it in, and we'll see if there's anything we missed.
Pressing play.
Here comes the demon.
And.
I see that its tail is a little bit off to the side.
And so it's missing a little bit.
I'm going to set this to number of players to one.
And I notice a little bit of a jerk when the demon was moving in.
And that is going to be because of its blend space.
I'm going to fix that really quick.
Assets, enemies, demon animations, blend space and go down to that weight speed.
I'm going to set it to four.
So let's look at that debug sphere.
So it's a little bit to the side there, right?
So what we can do is we can place that notify a little earlier in the attack.
So let's go to that attack montage.
Attack daemon.
So we're doing it here.
It should be probably more like here.
I'm going to move it back and I'm going to do that for the other attack as well.
It should be about here when it's about 90 degrees out there.
Let's see if that fixes it.
Saving all and pressing play.
Actually, it's a little worse.
I think I needed to go the other way.
So instead of right there, it needs to go to about probably what they're.
So I'm going to push it out a little bit.
That looked a little better.
So a little bit farther out about right there.
We'll do it for both of them and we'll play test.
That one missed.
So it just takes a little tweaking here.
I don't need the goblin.
I don't know why I have that open.
That was a dead hit.
Yeah, that's much better.
And it looks great with the blood, doesn't it?
Excellent.
That is looking really nice.
Nice little round house.
Perfect.
So we have working attacks.
So now that we have a attacking demon and it's looking really nice, I'd like a ranger attacker so we
could have another type of demon that throws things.
And we can do that.
Next, before we wrap up, I'm going to remove that debug sphere and I'm going to remove that debug
sphere there and.
We now have an attacking demon.
Excellent.
We'll continue in the next video.
We'll see you soon.