WEBVTT

00:06.850 --> 00:08.020
Welcome back.

00:08.050 --> 00:09.860
So we have some eye movement.

00:09.880 --> 00:13.570
We have our ranged attackers coming in, not so close.

00:13.570 --> 00:17.620
And our melee attackers coming in a little closer.

00:17.620 --> 00:22.240
And we see based on our red debug spheres, that they are trying to attack.

00:22.270 --> 00:29.950
Our attack behavior tree task is being executed, but all it does is show that red sphere.

00:29.950 --> 00:34.540
So we want some actual gameplay abilities for our enemies to attack.

00:34.570 --> 00:38.110
So we're going to begin with the melee attack.

00:38.140 --> 00:43.930
The melee attack is a little bit less complex than the ranged attackers attack.

00:43.930 --> 00:45.520
So we'll start with that.

00:45.520 --> 00:52.540
And in order to do that, I'd like to make a gameplay ability specifically for melee attacks.

00:52.540 --> 00:55.870
So we're going to create a new C plus plus class for that.

00:55.990 --> 01:01.360
I'm going to go to C plus plus classes or a public ability system abilities.

01:01.360 --> 01:05.680
And our melee gameplay ability is going to cause damage.

01:05.710 --> 01:06.500
Of course.

01:06.500 --> 01:10.250
So it's going to be based on aura damage, gameplay ability.

01:10.250 --> 01:17.600
So even though this is based on aura damage gameplay ability, which in turn is based on aura gameplay

01:17.600 --> 01:22.700
ability, don't think of these as abilities specific to aura character.

01:22.730 --> 01:26.960
These are base classes for the project Aura.

01:26.990 --> 01:30.140
Remember the project itself is called Aura in my case.

01:30.140 --> 01:34.040
So our enemies will be using this ability that we create.

01:34.070 --> 01:34.370
Now.

01:34.370 --> 01:39.710
It's going to be a damage gameplay ability, so it has a damage scalable float that we can use.

01:39.710 --> 01:46.190
So we're going to create a C plus plus class based on aura damage gameplay ability.

01:46.190 --> 01:52.250
It's going to go straight into abilities and we're going to call this aura melee ability.

01:52.250 --> 01:54.830
So this will be the melee attack.

01:54.860 --> 01:58.100
In fact, we can call this melee attack.

01:58.910 --> 02:02.600
You could even call it melee spell, but it's not really magic.

02:02.600 --> 02:04.520
So melee attack It is.

02:04.550 --> 02:05.990
Let's create the class.

02:05.990 --> 02:07.700
Let's close the editor.

02:07.700 --> 02:11.390
And now we have an aura melee attack class.

02:11.390 --> 02:14.990
I'm going to close all tabs, open up aura, melee attack.

02:14.990 --> 02:16.100
And here it is.

02:16.100 --> 02:17.930
Here's the CPP file.

02:18.020 --> 02:22.490
Now I'd like a gameplay tag associated with attacking.

02:22.490 --> 02:29.780
That's just going to make things a lot easier in the gas system as you can give these specific abilities,

02:29.780 --> 02:34.430
the attack tag and do all kinds of things with that information.

02:34.430 --> 02:37.970
You can even activate abilities by tag as we've seen.

02:38.120 --> 02:41.570
So I'm going to add a new gameplay tag to our native tags.

02:41.570 --> 02:43.940
That's an aura gameplay tags.

02:43.940 --> 02:50.120
And what I'd like to do is have an abilities sub tag or parent tag.

02:50.120 --> 02:57.650
So we're going to have F gameplay tag abilities underscore attack.

02:58.220 --> 03:00.080
So we'll just have abilities attack.

03:00.080 --> 03:05.030
If we need to distinguish between different kinds of attacks, we can have abilities, attack, melee

03:05.060 --> 03:09.750
abilities, attack, ranged abilities, attack spell and so on.

03:09.770 --> 03:17.360
For now, we're just going to have the attack tag and I'm going to go ahead and define this in the CPP

03:17.360 --> 03:19.820
file or a gameplay tags dot CPP.

03:20.120 --> 03:21.920
Let's go ahead and do that.

03:21.950 --> 03:28.040
So just down here at the bottom, I'm going to copy the effects with the comment and everything.

03:28.850 --> 03:33.140
We're going to paste it and I'm just going to have abilities here.

03:34.070 --> 03:37.190
And the first one will be abilities attack.

03:37.370 --> 03:48.920
So the name will be abilities dot attack and the F string will be attack ability tag.

03:49.190 --> 03:53.930
So we have a new gameplay tag called Abilities Attack.

03:53.930 --> 03:54.620
Great.

03:54.620 --> 03:57.080
And we also have an aura melee attack.

03:57.080 --> 03:57.840
Also.

03:57.840 --> 03:58.440
Great.

03:58.470 --> 04:04.630
Now we're going to need a way for our enemies to be granted the melee ability.

04:04.650 --> 04:06.390
Well, not all of them, right?

04:06.390 --> 04:09.630
Some of the enemies are going to need melee abilities.

04:09.630 --> 04:13.920
Some of them are going to need ranged attacks and others still might need spells.

04:13.920 --> 04:15.780
So it depends on the class.

04:15.780 --> 04:21.600
But we have a class for the character default info, default abilities and such.

04:21.600 --> 04:25.230
That's going to be in the ability system data.

04:25.230 --> 04:29.100
And we have this data asset called character class info.

04:29.130 --> 04:34.810
Here's where we decide what each character class is supposed to start with.

04:34.830 --> 04:42.390
Now we have this character class default info struct and we have a team map mapping the character class

04:42.390 --> 04:43.650
to that struct.

04:43.650 --> 04:50.490
So whatever's in this struct, we can set those default properties for each class individually.

04:50.490 --> 04:55.770
And then of course each character class type has common class defaults.

04:55.770 --> 05:00.390
That's the common abilities, vital and secondary attributes and so on.

05:00.480 --> 05:08.610
But if we want each character class to have its own unique set of either abilities or gameplay effects

05:08.610 --> 05:15.360
that would go into character class default info and we can set those individually per character class.

05:15.360 --> 05:23.490
So what I'd like here is a set of abilities that each character class should start the game with by

05:23.490 --> 05:30.210
default, and this should be an array of gameplay abilities as they may need more than one.

05:30.210 --> 05:36.000
So we're going to have a t array of t sub class of gameplay abilities, just like common abilities here.

05:36.030 --> 05:42.870
I'm going to go ahead and just copy that t array declaration and paste it up here and character class

05:42.870 --> 05:44.220
default info.

05:44.220 --> 05:52.200
And this is going to be in the category of class defaults rather than common class defaults and it's

05:52.200 --> 05:54.420
going to be edit defaults only.

05:54.450 --> 05:57.510
It's a t array of t sub class of gameplay abilities.

05:57.510 --> 06:05.190
It's called common abilities and it's up to us to fill in those common abilities for each given class.

06:05.550 --> 06:10.710
Now that doesn't mean they're going to be just granted this set of abilities by default.

06:10.710 --> 06:15.270
That's something that we have to do ourselves and we could do that.

06:15.300 --> 06:21.030
We can easily see an example of how it's done by seeing how the common abilities are granted.

06:21.030 --> 06:24.990
So where are we granting those common abilities anyway?

06:25.170 --> 06:29.210
Let's take a look at our blueprint function library.

06:29.220 --> 06:30.780
Where did we put that?

06:30.780 --> 06:37.050
Well, it's Aura ability system library, and we have our give startup abilities here, which takes

06:37.050 --> 06:41.340
in a world context object, an ability system component.

06:41.370 --> 06:46.890
Let's go to the CPP file and see that give startup abilities function and here it is.

06:46.890 --> 06:53.160
So give startup abilities is going to get the character class info data asset and that exists on the

06:53.160 --> 06:53.940
game mode.

06:53.940 --> 07:00.150
So it's getting it from the game mode using get character class info and then it's looping through each

07:00.150 --> 07:02.310
class and common abilities.

07:02.310 --> 07:06.150
So this is handling the common startup abilities, right?

07:06.150 --> 07:12.330
But it'd be nice if this function just automatically handles giving those class specific abilities as

07:12.330 --> 07:12.900
well.

07:12.900 --> 07:14.610
Now how would it manage to do that?

07:14.610 --> 07:19.440
It would have to know what the character class is for a given character.

07:19.440 --> 07:25.620
So if we could change this function to take in the enum for the character class, then it could look

07:25.620 --> 07:32.250
up that character class in the map and get those class specific gameplay abilities and give those as

07:32.250 --> 07:32.880
well.

07:33.090 --> 07:35.940
So I think that's what I'd like this function to do.

07:35.940 --> 07:38.820
I'd like it to be smart enough to do that.

07:38.820 --> 07:44.700
So we're going to have to give this give startup abilities a input for the enum.

07:44.700 --> 07:51.870
So going back into the header file for our Ability System library, we're going to need to add that

07:51.870 --> 07:56.390
enum and that enum is defined in character class info dot h.

07:56.400 --> 07:56.970
Which means.

07:56.990 --> 08:03.110
We're going to need to make sure that that is an include here, which it is in our ability system library

08:03.110 --> 08:05.430
header file, so we can use that enum.

08:05.480 --> 08:09.500
In fact, we're using it here in initialize default attributes.

08:09.530 --> 08:12.590
We're going to do that here now and give startup abilities.

08:12.590 --> 08:16.010
Let's go ahead and just add that as an input parameter.

08:16.010 --> 08:17.690
We'll make it the last one.

08:18.140 --> 08:22.940
So if we're going to add it to the function declaration, we must add it to the function definition

08:22.940 --> 08:25.340
in the CPP file right here.

08:25.340 --> 08:32.030
Now before we go and implement the functionality here, we need to change everywhere we're calling this

08:32.030 --> 08:32.720
function.

08:32.720 --> 08:35.960
We need to make sure to pass in that enum value.

08:36.110 --> 08:43.430
So the easiest way to find out where we need to change our code is to compile our code because we'll

08:43.430 --> 08:49.970
get some nice compiler errors telling us exactly where we're calling this function and not passing in

08:49.970 --> 08:51.140
enough inputs.

08:51.170 --> 08:55.010
Right here we're seeing it's in Ora enemy CPP.

08:55.040 --> 08:58.670
Line 82 says this function does not take two arguments.

08:58.670 --> 09:02.090
We can double click on that and go straight to the violation.

09:02.150 --> 09:05.030
So here we're calling give startup abilities, right?

09:05.030 --> 09:10.670
And our Ora enemy has its own character class enum, doesn't it?

09:10.670 --> 09:19.880
If we go to the header file for Ora Enemy and search for character class, here we have character class.

09:19.880 --> 09:23.240
So we have access to that right here in the enemy class.

09:23.240 --> 09:28.040
I'm going to close the header file and we're just going to pass that in for the third input parameter

09:28.070 --> 09:29.450
character class.

09:30.620 --> 09:33.410
And that's going to satisfy give startup abilities.

09:33.410 --> 09:39.170
If I compile once again, then that should get rid of that compiler error.

09:39.170 --> 09:41.810
So that handles any errors that we created.

09:41.810 --> 09:47.450
By adding that input to give startup abilities, we see that we're only calling this once in Beginplay

09:47.450 --> 09:48.710
for the Ora enemy.

09:48.740 --> 09:51.980
We're not using this for our player controlled character.

09:51.980 --> 09:56.780
For that, we're using the abilities that we've set on the character blueprint itself.

09:56.780 --> 10:03.680
But for this, for enemies, we're going to get those abilities from character class info, the data

10:03.680 --> 10:04.400
asset.

10:04.520 --> 10:11.210
So now we need to make sure to give those abilities here and give startup abilities in Ora Ability System

10:11.210 --> 10:12.230
Library.

10:12.350 --> 10:13.730
So how are we going to do that?

10:13.730 --> 10:21.080
Well, we have character, class info and character class info has the t map mapping from the E character

10:21.080 --> 10:28.700
class to a specific struct that contains those default abilities for the specific class.

10:28.700 --> 10:29.240
Right?

10:29.240 --> 10:32.990
So what we're going to do is access character class info.

10:35.520 --> 10:43.230
And we have a function that can give us the class default info for a given character class type.

10:43.500 --> 10:48.420
So if we call get class default info, we can pass in that character class.

10:49.080 --> 10:54.180
Now this is going to return us that f character class default info struct.

10:54.450 --> 10:58.770
So let's store that in a local variable, but I'm going to make it a const reference.

10:58.770 --> 11:03.960
So f character class default info const reference.

11:03.960 --> 11:07.140
I'm going to call this default info.

11:08.100 --> 11:14.580
Now give startup abilities as we know could have a null pointer for get character class info as this

11:14.580 --> 11:16.530
is only valid on the server.

11:16.530 --> 11:25.320
So I'm going to say if character class info is a null pointer, we're going to return early and now

11:25.320 --> 11:30.630
that we have the default info, we know that there's an array of gameplay abilities in here, so we're

11:30.630 --> 11:31.800
going to loop through that.

11:31.830 --> 11:41.610
We're going to loop through, we're going to say first auto ability class in default info dot and it

11:41.610 --> 11:44.010
looks like I call this common abilities.

11:44.040 --> 11:45.860
Did I call it common abilities?

11:45.870 --> 11:51.160
Let's go to character class info into that struct and yes, I called it common abilities.

11:51.160 --> 11:53.410
This is not actually common abilities, right?

11:53.410 --> 11:56.260
This is abilities specific to the given class.

11:56.260 --> 12:01.630
So really I think this should be called either just abilities or start up abilities.

12:01.630 --> 12:03.790
I'm going to call it startup abilities.

12:04.580 --> 12:08.660
And go back to our ability system Blueprint Library.

12:08.900 --> 12:11.540
And we should now see start up abilities.

12:11.840 --> 12:17.210
Now I know that Ability class is a subclass of gameplay ability, so I'm going to go ahead and change

12:17.210 --> 12:19.070
it from auto to this.

12:19.070 --> 12:22.030
And now we have our ability class.

12:22.040 --> 12:24.900
We just need to give the startup ability.

12:24.920 --> 12:26.240
Now here's the thing.

12:26.240 --> 12:32.510
We can create an ability spec at level one, just like we did before, but these are going to be things

12:32.510 --> 12:34.640
like attack abilities and so on.

12:34.640 --> 12:41.090
So it's possible that we might want to start these enemies off with abilities of different levels.

12:41.090 --> 12:46.580
And if that's the case, we are going to want to know what the level is for our enemy.

12:46.610 --> 12:48.560
So just something to think about.

12:48.590 --> 12:55.190
We may want to access the player level from our character and we know that our character, our enemy

12:55.190 --> 12:58.910
itself does implement an interface.

12:58.940 --> 13:01.820
We know that it also implements the combat interface.

13:01.820 --> 13:07.170
That's thanks to the base character class inheriting from combat interface as well.

13:07.200 --> 13:08.730
I Combat interface.

13:09.060 --> 13:09.450
Okay.

13:09.450 --> 13:12.600
Closing Aura Character Base Closing Aura Enemy.

13:12.600 --> 13:15.300
Let's go really quick to combat interface.

13:17.040 --> 13:23.430
And we can see that we have a jet player level so we can easily get the player level if we can get the

13:23.430 --> 13:24.870
actual character.

13:24.900 --> 13:25.290
Okay.

13:25.290 --> 13:30.110
Closing combat interface back to Aura Ability System Library, CP.

13:30.300 --> 13:35.480
So how do we get that character associated with a given ability system component?

13:35.490 --> 13:42.390
Well, we have the ASC so we can get the ASC and we know that we can get the Avatar actor.

13:42.390 --> 13:49.740
So get Avatar, here's the Avatar actor And if we cast this to the combat interface, then we can get

13:49.740 --> 13:50.490
its level.

13:50.490 --> 13:55.200
So we're going to cast it to a combat interface.

13:55.230 --> 14:00.210
Now the header was automatically included, so make sure you include the header if you're not using

14:00.210 --> 14:01.800
writers, auto include.

14:02.400 --> 14:05.250
So we're going to cast an eye combat interface.

14:05.250 --> 14:11.070
We're going to store that in an eye combat interface pointer called Combat interface.

14:11.520 --> 14:19.380
Now that we have the combat interface, we're going to say if combat interface, then we know combat

14:19.380 --> 14:24.000
interface get player level, we can call get player level.

14:24.000 --> 14:27.920
And we know that we now have the level for the character.

14:27.930 --> 14:32.100
Now if we create an ability spec, we can set it to that level.

14:32.100 --> 14:37.380
So I'm going to copy this line where we're making our ability spec, I'm going to make an ability spec,

14:37.380 --> 14:42.420
but instead of just hard coding one, I'm now going to pass in player level.

14:43.080 --> 14:50.190
Now, I'm not really concerned with the level for the common abilities as these are things that will

14:50.190 --> 14:54.000
not really change based on level, at least by my design.

14:54.030 --> 14:56.280
These are things like hit, react and death.

14:56.280 --> 14:59.760
When we make that one, these are going to be the same for all levels.

14:59.760 --> 15:01.800
We're not going to level up those abilities.

15:01.800 --> 15:07.500
If you plan on changing the levels and changing behavior based on level, you may wish to pass something

15:07.500 --> 15:08.880
in other than one here.

15:08.880 --> 15:16.830
But for my start up abilities per class, I'm going to pass in the character's level just so those specific

15:16.830 --> 15:23.190
abilities, which will be things like attacks, can potentially get stronger if we're spawning in an

15:23.190 --> 15:25.050
enemy at a higher level.

15:25.290 --> 15:31.020
Okay, so now that we have the ability spec, the last thing to do here is to give the ability that's

15:31.020 --> 15:34.230
using this line here, ask, give ability.

15:34.230 --> 15:40.520
And now our enemy should be given all abilities in its array of start up abilities.

15:40.530 --> 15:45.070
Now, Ryder's going to tell us that the combat interface can be moved inside the if statement if we

15:45.070 --> 15:45.780
want.

15:45.790 --> 15:47.830
So just an option.

15:47.830 --> 15:50.890
If you want to do that, you could cut it and paste it here.

15:50.920 --> 15:52.120
That's up to you.

15:52.480 --> 15:56.980
But now we have our start up abilities given to our enemies.

15:57.010 --> 16:01.090
Now what's the easiest way to test out that this is working?

16:01.090 --> 16:04.540
Well, that would be to try to activate the ability, right?

16:04.540 --> 16:09.130
As we know, give startup abilities is being called already.

16:09.310 --> 16:14.950
So why don't we compile and launch the editor and see if we can really quickly test this out to make

16:14.980 --> 16:18.490
sure that our enemies are getting some start up abilities.

16:19.820 --> 16:20.300
Okay.

16:20.300 --> 16:26.060
So back in the editor, I know that I have a new Cplusplus class called Aura Melee Attack.

16:26.090 --> 16:30.940
I'd like to make a blueprint based on this ability specifically for my goblin.

16:30.950 --> 16:37.700
So I'm going to go to blueprints, I'm going to go to Ability System and I'm just going to go into gameplay

16:37.700 --> 16:42.260
abilities and make an ability right here next to these other two.

16:42.290 --> 16:46.280
So I'm going to choose New Blueprint class and choose Aura.

16:47.100 --> 16:48.150
Melee.

16:49.370 --> 16:50.120
Attack.

16:50.240 --> 16:52.430
We're going to make a blueprint based on that.

16:52.430 --> 16:55.520
And this is going to be a underscore.

16:55.520 --> 16:58.940
And this can be goblin spear attack.

16:59.810 --> 17:02.480
So opening goblin spear attack.

17:02.480 --> 17:05.270
Here we have our goblin spear attack.

17:05.300 --> 17:06.890
Now, here's the thing.

17:06.890 --> 17:10.280
We know that we can activate abilities by tag, right?

17:10.310 --> 17:12.500
That's how we're activating our hit react.

17:12.500 --> 17:16.700
If we go to hit React, it has a tag in its ability tags effects.

17:16.910 --> 17:17.780
Hit react.

17:17.810 --> 17:22.190
If it has a tag in its ability tags, it can be activated by tag.

17:22.220 --> 17:27.800
We're going to add our newly created attack tag to our ability tags.

17:27.800 --> 17:34.130
So opening the dropdown, we're going to go to Abilities Attack and make sure that we have the attack

17:34.160 --> 17:34.910
tag.

17:35.000 --> 17:39.530
Now that we have that, we know that we can activate this ability by tag.

17:39.620 --> 17:41.480
Okay, that's good.

17:41.690 --> 17:49.950
We also want our goblin, or at least our warrior class to be given this goblin spear attack.

17:50.160 --> 17:53.760
In fact, I don't think I want this to be specific to the Goblin.

17:53.760 --> 17:56.880
I want it to be specific to the warrior class.

17:56.880 --> 18:01.250
So what I'm going to do is actually call this G a underscore.

18:01.260 --> 18:03.630
We'll just call it melee attack.

18:03.990 --> 18:10.260
So this will be something we can call for anything that wants to use a melee attack.

18:10.380 --> 18:14.340
Now, let's add this to the character class defaults.

18:14.340 --> 18:17.730
That's going to be in blueprints, ability system data.

18:17.730 --> 18:19.980
And we have character class info.

18:19.980 --> 18:26.130
And notice that our map now has an additional array in each of these structs.

18:26.130 --> 18:31.380
For the warrior, we have startup abilities and we're going to add one to it and we're going to select

18:31.380 --> 18:35.670
from the dropdown our new Gar melee attack.

18:35.760 --> 18:39.650
So only the Warriors are going to get this melee attack.

18:39.660 --> 18:47.190
So now that our Goblin Spear should be granted this ability, we now need to try to activate it and

18:47.190 --> 18:49.770
see if it actually gets activated.

18:49.770 --> 18:54.180
And one way we can do that is from our behavior tree task.

18:54.180 --> 19:03.060
So if we go to blueprints I tasks BT attack instead of drawing a debug sphere here, we don't want to

19:03.060 --> 19:04.430
do that anymore.

19:04.440 --> 19:10.350
Instead, we're going to try to activate the ability with the attack tag.

19:10.710 --> 19:11.850
How do we do that?

19:11.850 --> 19:15.030
Well, we need to get the ability system component.

19:15.060 --> 19:18.060
We know that we get the controlled pawn here.

19:18.060 --> 19:25.080
So from the controlled pawn we can call get ability system component as this is the blueprint library

19:25.080 --> 19:28.020
function ability system, blueprint library.

19:28.200 --> 19:34.740
So if we have this ability system component, we can try to activate an ability by tag, we can say

19:35.070 --> 19:36.210
activate.

19:37.380 --> 19:39.150
Abilities by tag.

19:39.300 --> 19:42.610
It's actually try activate abilities by tag.

19:42.630 --> 19:45.240
This requires a gameplay tag container.

19:45.360 --> 19:51.900
So what we can do is make a gameplay tag container by dragging off of gameplay tag container and we

19:51.900 --> 19:53.250
have to make one from an array.

19:53.250 --> 20:00.180
So we're going to choose make gameplay tag container from array and we can make an array from a gameplay

20:00.180 --> 20:00.900
tag.

20:00.930 --> 20:07.440
I'd like to make this gameplay tag an actual member variable on BT attack.

20:07.440 --> 20:09.690
So we're going to make a variable.

20:09.690 --> 20:12.210
We're going to call this attack tag.

20:12.330 --> 20:14.790
We're going to change it to gameplay tag.

20:17.550 --> 20:23.610
We're going to compile and give this a default value and it's going to be abilities attack.

20:24.350 --> 20:29.480
And then we're going to take that attack tag, get it, and we're going to hook it in here.

20:29.510 --> 20:35.300
That's going to give us an automatic make array that will make us a gameplay tag container from that

20:35.300 --> 20:35.900
array.

20:35.900 --> 20:39.230
And we can pass that into try activate abilities by tag.

20:39.320 --> 20:45.710
And in fact, we don't have to make this from an array we can drag off of attack tag and make gameplay

20:45.710 --> 20:48.670
tag container from tag.

20:48.680 --> 20:51.890
This skips that intermediate step of the array.

20:52.130 --> 20:57.230
This is a little bit cleaner and we can hook up that gameplay tag container.

20:57.350 --> 21:04.040
So here our behavior tree task is now going to attempt to activate abilities by tag.

21:04.040 --> 21:10.310
And this is great because we can have all sorts of different gameplay abilities on our enemies and if

21:10.310 --> 21:16.460
they have that attack tag, then it doesn't matter what gameplay ability it is as long as it has the

21:16.460 --> 21:17.450
attack tag.

21:17.570 --> 21:24.270
So we're going to try activate abilities by tag in our task now and we can just check to make sure this

21:24.270 --> 21:31.410
is working in our melee attack by simply drawing a debug sphere at the location of the enemy.

21:31.710 --> 21:33.990
So I'm going to draw debug sphere here.

21:37.140 --> 21:39.630
I'm going to make it a red debug sphere.

21:39.660 --> 21:49.110
I'm going to give it a radius of 40 and the center will be at the Avatar actor that owns this melee

21:49.110 --> 21:50.220
attack ability.

21:50.250 --> 21:51.210
How do we get that?

21:51.210 --> 21:57.090
Well, we can type get avatar and we have get Avatar actor from actor info.

21:57.120 --> 21:59.790
All we need to do is get its actor location.

21:59.790 --> 22:06.090
So get actor location from it and hook that into the center of our debug sphere.

22:06.120 --> 22:12.210
I'm going to give it a duration of 0.5 seconds really quick and we're going to activate the ability,

22:12.240 --> 22:18.270
draw the debug sphere and deactivate or end the ability immediately.

22:21.440 --> 22:22.580
Perfect.

22:22.850 --> 22:31.790
And we can even go to our class defaults and we can set our instancing policy to instance per actor.

22:31.820 --> 22:38.360
That way we don't instance this once each execution, but only once and then reuse the same ability.

22:38.960 --> 22:43.940
Okay, so if all is well, we should see the same behavior.

22:43.940 --> 22:46.250
We're still just drawing a debug sphere.

22:46.280 --> 22:51.740
Let's make the debug sphere a different color just so we can see that this is no longer the debug sphere

22:51.740 --> 22:54.950
drawn from our behavior tree task attack.

22:54.980 --> 22:56.780
That's not happening anymore.

22:56.810 --> 23:00.920
Now our behavior tree task is activating an ability by tag.

23:01.530 --> 23:04.500
And our melee attack is drawing the debug sphere.

23:06.010 --> 23:07.660
So saving all.

23:07.870 --> 23:09.130
Let's see what happens.

23:09.130 --> 23:12.220
If we press play, we should only see something happen.

23:12.220 --> 23:14.080
Now, if it's our melee.

23:14.080 --> 23:15.130
And look at that.

23:15.160 --> 23:18.490
Our melee character is attacking.

23:18.490 --> 23:21.250
And we know that this is because of a gameplay ability.

23:21.250 --> 23:25.000
Now, it's not just from the behavior tree task.

23:25.000 --> 23:30.430
So the behavior tree is actually activating a gameplay ability in the gas system.

23:30.430 --> 23:36.730
So we've made the link between behavior tree and gameplay ability system.

23:37.000 --> 23:37.840
Beautiful.

23:37.840 --> 23:38.770
This is great.

23:38.770 --> 23:41.020
This is a very good sign.

23:41.020 --> 23:45.850
Now we don't have any attack abilities for our ranged attackers yet.

23:45.880 --> 23:47.350
We'll get to that, don't worry.

23:47.350 --> 23:50.590
But for now we know that our melee attack is working.

23:50.590 --> 23:56.590
It's now time to start doing things in our melee attack other than drawing just debug shapes.

23:56.590 --> 23:57.070
Right.

23:57.070 --> 24:02.830
And this is also great because we have our system set up so that Ranger Warrior and Elementalist can

24:02.830 --> 24:08.420
each get their own unique attack abilities or really any abilities that we want to give them.

24:08.570 --> 24:15.710
And we know that if those are attack abilities and they all have their ability tags container containing

24:15.710 --> 24:22.400
the abilities attack gameplay tag, then we can activate that ability just by specifying attack.

24:22.400 --> 24:28.040
And no matter what kind of character it is, whether it's a ranger, an Elementalist or a warrior,

24:28.040 --> 24:33.890
it will execute any and all abilities that it contains with the attack tag.

24:33.920 --> 24:35.090
Perfect.

24:35.360 --> 24:37.370
So this is a great stopping point.

24:37.370 --> 24:38.240
Excellent job.

24:38.240 --> 24:40.850
Save your work and I'll see you in the next video.
