WEBVTT

00:06.840 --> 00:07.980
Welcome back.

00:08.130 --> 00:14.880
Now we have a melee attack, but we could easily make a ranged attacker for our demon.

00:14.880 --> 00:18.160
And I'd like to do that in this video.

00:18.180 --> 00:21.090
Now we have a demon throw, and it's pretty simple.

00:21.090 --> 00:23.060
Just a little throw animation.

00:23.070 --> 00:24.930
We're going to make a montage out of this.

00:24.930 --> 00:28.260
But first, we need to check enable root motion on it.

00:28.290 --> 00:36.360
We'll save and we'll go ahead and right click, create and a montage, and we'll call this aim demon

00:36.360 --> 00:37.080
throw.

00:39.380 --> 00:45.410
And just like with our other montages, we just need to add a couple things, right?

00:45.440 --> 00:48.770
We want a motion warping notify track.

00:48.770 --> 00:50.240
So a motion warping.

00:50.750 --> 00:56.030
And I'll just really quickly add another one called Sounds and we'll just use these two.

00:56.120 --> 01:01.570
So for motion warping, I'm going to add a notify state motion warping.

01:01.580 --> 01:11.090
We'll go to about here, change this to facing target, uncheck warp translation rotation type to facing

01:11.090 --> 01:20.090
and we're going to send an event right about here and this is going to be closer to our ranged attackers

01:20.090 --> 01:23.210
for the goblin are arranged slingshot attackers.

01:23.210 --> 01:23.780
Right.

01:23.810 --> 01:28.190
The only difference is we don't have a weapon, but we are going to send an event.

01:28.190 --> 01:30.740
So add, notify, montage, event.

01:30.740 --> 01:36.860
And for the event tag, we're going to make this montage attack one.

01:36.860 --> 01:42.660
And that's because I'd like this to be a different demon class.

01:42.690 --> 01:45.750
We'll have a demon that's a warrior and a demon.

01:45.780 --> 01:47.490
That's not a warrior.

01:47.490 --> 01:48.630
It's a ranger.

01:48.720 --> 01:52.710
So for that reason, the Ranger is just going to have the one attack.

01:52.710 --> 01:56.010
So we have montage attack one.

01:56.010 --> 02:02.550
And finally, we can place a sort of swiping sound for this as well.

02:02.550 --> 02:09.120
So let's go ahead and add a notify play sound and we'll just use Swipe.

02:11.160 --> 02:12.030
That's fine.

02:12.030 --> 02:15.180
And actually, I'm going to go to swipe.

02:15.180 --> 02:17.460
I'm going to duplicate it and make a swipe.

02:17.460 --> 02:18.060
Quiet.

02:18.060 --> 02:20.010
So swipe, underscore.

02:20.190 --> 02:21.300
Quiet.

02:23.070 --> 02:30.240
And I'm going to change the volume multiplier to 0.1 and change the pitch to go to a minimum of negative

02:30.240 --> 02:32.460
three and we'll use that.

02:32.460 --> 02:34.920
So back to the demon throw.

02:34.950 --> 02:37.350
We'll change this to swipe quiet.

02:40.680 --> 02:41.370
Cool.

02:41.610 --> 02:42.090
All right.

02:42.090 --> 02:45.390
So we have a demon ranged attack now.

02:45.720 --> 02:53.550
Now, this is going to be somewhat different because we're going to have a demon that has a melee attack.

02:53.580 --> 02:54.930
That's this demon.

02:54.930 --> 02:58.980
We should rename it to Demon Melee or Demon Warrior.

02:58.980 --> 03:03.070
And then we'll have another demon that will be a demon ranger.

03:03.090 --> 03:10.050
So I'm going to rename this demon to Demon Warrior, and this will have the character class warrior.

03:10.200 --> 03:15.780
But I'm also going to right click on it and duplicate it and have a demon ranger.

03:17.420 --> 03:19.550
And this one will be different.

03:19.580 --> 03:22.100
This demon is going to have a different character class.

03:22.100 --> 03:27.740
So we're going to set character class to Ranger and we're going to search for attack and remove its

03:27.740 --> 03:28.850
attack montages.

03:28.850 --> 03:31.970
I'm going to hit the trash can and just add one.

03:31.970 --> 03:35.810
And this will have the montage and demon throw.

03:35.840 --> 03:41.150
The montage tag is going to be one because we set it to one and the socket tag can be different.

03:41.150 --> 03:42.860
This can be a hand socket.

03:42.860 --> 03:44.960
It needs to be our left hand right.

03:44.960 --> 03:48.500
So let's make sure that our demon has a left hand socket.

03:48.530 --> 03:51.620
We're going to go down to wrist L That's right there.

03:51.620 --> 03:52.970
And we're going to right click.

03:52.970 --> 03:55.820
We're going to add a socket and we're going to call this.

03:56.400 --> 03:58.650
Left hand socket.

03:58.680 --> 04:05.640
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

04:05.670 --> 04:07.230
there, right about there.

04:07.230 --> 04:09.630
And go back to my demon.

04:09.680 --> 04:11.670
Beep demon ranger.

04:11.670 --> 04:15.930
And we're going to set the socket tag to left hand.

04:16.530 --> 04:25.020
And I'm going to search for left hand socket name and set that we need this set to left hand socket.

04:26.090 --> 04:30.290
And because this is a ranger, it's going to be given the ranged attack.

04:30.530 --> 04:33.050
Let's just really quickly go to that ability.

04:33.080 --> 04:39.090
Content, blueprints, ability, system, enemy abilities, and we'll open our ranged attack.

04:39.110 --> 04:42.650
Now, what do we do when we receive the event?

04:42.680 --> 04:47.300
We get the combat socket location and we spawn a projectile.

04:47.360 --> 04:50.240
And what is the projectile that we spawn?

04:50.240 --> 04:58.100
Well, in a ranged attack, it's projectile class and it's hardcoded to slingshot rock.

04:58.130 --> 05:04.670
So really, if this is a ranger, we should be getting the correct projectile, right?

05:04.670 --> 05:11.570
Unless we don't mind that our range attackers all just shoot rocks because as it stands, we're going

05:11.570 --> 05:15.260
to be throwing rocks, which actually is kind of cool.

05:15.350 --> 05:16.700
Let's see if it works.

05:16.700 --> 05:21.650
I'm going to remove this demon because this is a demon warrior.

05:21.650 --> 05:24.130
I'm going to delete that and go to blueprints.

05:24.140 --> 05:28.920
Character Demon, and we're going to bring in a demon ranger instead.

05:28.950 --> 05:30.860
Let's see what happens if we press play.

05:30.870 --> 05:33.720
First, I'm going to save all and then press play.

05:38.220 --> 05:38.640
Okay.

05:38.640 --> 05:45.450
So it actually looks like our enemy is getting a collision most likely with itself.

05:45.450 --> 05:53.100
We can tell for sure since we're running in debug mode by placing a breakpoint in that aura projectile.

05:53.100 --> 05:58.350
And on overlap we can check the other component, the other actor and so on.

05:58.350 --> 06:00.510
So I'm going to place a breakpoint there.

06:01.450 --> 06:02.500
And press play.

06:03.950 --> 06:05.840
And see what the other actor is.

06:05.870 --> 06:11.690
And it looks like the other actor is static mesh actor 26 It's the tile.

06:12.340 --> 06:15.160
So I'm going to remove that breakpoint and continue.

06:19.170 --> 06:22.050
And let's see why we're getting that.

06:24.350 --> 06:28.070
It looks like we're not spawning at the correct location.

06:28.070 --> 06:30.710
So I'm going to go to my ranged attack.

06:31.610 --> 06:35.690
And I see here in my ranged attack we're calling Spawn projectile.

06:35.690 --> 06:38.900
We're not actually using this socket location at all.

06:38.900 --> 06:47.570
And if we go into our ability system abilities folder and into Aura projectile spell, we're getting

06:47.570 --> 06:53.750
the socket location here and it looks like we're always getting combat socket weapon.

06:53.750 --> 07:00.080
So it seems like this ability should take in a gameplay tag for this for the combat socket.

07:00.110 --> 07:06.680
Otherwise it's just going to spawn at combat socket weapon, which is not going to work when we're spawning

07:06.680 --> 07:08.150
it from the hand, right?

07:08.180 --> 07:10.220
So we're going to need to fix that.

07:10.370 --> 07:15.800
So I'm going to go ahead and close out of the editor and we're going to change Spawn Projectile so it

07:15.800 --> 07:18.590
takes in a gameplay tag for the socket.

07:18.590 --> 07:26.480
So I'm going to open up Aura projectile spell H, go into spawn projectile and add a second input parameter

07:26.480 --> 07:34.010
and it will be a const F gameplay tag reference and we'll call this socket tag.

07:34.310 --> 07:41.480
Now this is a reference so we can forward declare the gameplay tag without having to include gameplay

07:41.480 --> 07:42.590
tag container.

07:42.860 --> 07:46.850
So we'll forward declare the struct f gameplay tag.

07:49.590 --> 07:58.710
And we'll add this as an input to spawn projectile and we'll pass socket tag in to get combat socket

07:58.710 --> 08:02.460
location instead of hard coding in the weapon this time.

08:02.460 --> 08:06.000
Now that means we'll have to change this in a couple of spots, right?

08:06.000 --> 08:10.620
So let's compile and we'll launch and fix where it broke.

08:11.820 --> 08:14.950
So we'll go ahead and get that ability open again.

08:15.000 --> 08:20.700
I don't think we need too many of these other tabs open, but for now, I'm going to go ahead and close

08:20.730 --> 08:23.700
daemon throw and back in the range attack.

08:23.700 --> 08:26.340
We need to pass in a socket tag, right?

08:26.370 --> 08:34.590
Well, we have that socket tag and I'm going to grab it here from break tag montage, reroute it.

08:35.460 --> 08:37.500
And we'll bring it all the way over here.

08:39.070 --> 08:41.650
And pass it into spawn projectile.

08:42.250 --> 08:45.010
Okay, so that's looking good.

08:45.040 --> 08:49.060
We also realized we're not using this jet combat socket location.

08:49.060 --> 08:51.250
We can remove that altogether.

08:52.500 --> 08:54.840
And I just messed up.

08:54.840 --> 09:00.240
This should be event received, so got to be careful which wires we hook up.

09:00.240 --> 09:02.550
So with that, let's test this out.

09:03.440 --> 09:07.490
Oh, and of course we have a blueprint error in Firebolt.

09:07.520 --> 09:08.810
Let's go to that.

09:08.810 --> 09:15.050
And the reason that we have an error is because we need to pass in that socket tag for spawn projectile

09:15.050 --> 09:15.890
as well.

09:15.890 --> 09:21.980
And here for Firebolt, it's okay if we pass in a hardcoded tag.

09:21.980 --> 09:28.400
So we're going to drag off of socket tag, we're going to make a literal gameplay tag and set it to

09:28.400 --> 09:30.620
combat socket weapon.

09:30.620 --> 09:35.990
So we were hard coding it in C plus plus before because that's what aura uses.

09:36.080 --> 09:39.950
Well, Firebolt is for aura, so we're going to use weapon there.

09:40.220 --> 09:43.700
And with that, let's go ahead and press play.

09:43.850 --> 09:47.450
Aura still works and now our.

09:48.280 --> 09:50.860
Demon is throwing rocks.

09:50.860 --> 09:51.880
How rude.

09:52.240 --> 09:53.640
And it's working.

09:53.650 --> 09:55.900
So we have a ranger demon as well.

09:56.460 --> 09:57.840
Which is really cool.

09:57.840 --> 10:05.430
And if we really wanted to, we could change the material for our Ranger because, well, we have a

10:05.430 --> 10:06.540
dark material.

10:06.540 --> 10:13.920
So if I go to Demon Ranger and select the mesh and scroll down, we have Demon red.

10:13.920 --> 10:17.490
But if I click the dropdown, we have Demon Dark as well.

10:17.490 --> 10:19.090
And here's what it looks like.

10:19.110 --> 10:19.890
Pretty cool.

10:19.890 --> 10:24.510
So this could be what our ranger demons look like.

10:24.540 --> 10:25.680
They're darker.

10:25.710 --> 10:27.570
A little bit more serious, right?

10:29.540 --> 10:30.890
Pretty awesome.

10:32.910 --> 10:40.380
And if we want to see what both demons look like together, we can go to Character demon and bring in

10:40.380 --> 10:44.370
the Demon Warrior, maybe two of them, and press play.

10:44.670 --> 10:51.270
And we have two of the roundhouse demons and one throwing rocks.

10:52.800 --> 10:53.840
All right.

10:53.850 --> 10:59.130
So we're one step closer to having our demon character.

10:59.130 --> 11:03.090
We still have some other things to polish up, and we'll do those next.

11:03.270 --> 11:04.350
I'll see you soon.
