WEBVTT

00:07.130 --> 00:08.240
Welcome back.

00:08.240 --> 00:11.600
So we have a pretty nice electrocute ability.

00:11.780 --> 00:16.340
And we're going to want a debuff associated with it.

00:16.340 --> 00:18.830
So I'd like to make a stun effect.

00:18.830 --> 00:23.090
And the stun effect is going to immobilize the enemy.

00:23.300 --> 00:31.400
If you want you can have a periodic damage amount applied while in the stun debuff status, but I'd

00:31.400 --> 00:34.220
really like no damage applied.

00:34.220 --> 00:40.400
I would just like to show that the enemy is in that stun debuff, and that they're immobilized, and

00:40.400 --> 00:45.950
play a different animation to show that they're stunned and a different particle system, and so on.

00:46.700 --> 00:48.140
So we're going to implement that.

00:48.140 --> 00:56.480
But before we do, I'm going to show one little issue that we have now that we have two different spells.

00:56.510 --> 00:58.520
The Firebolt and electrocute.

00:58.550 --> 01:00.770
Now it's kind of hard to reproduce.

01:00.770 --> 01:08.270
But if I cast the Firebolt and while I'm casting the Firebolt, if I cast electrocute before the Firebolt

01:08.270 --> 01:11.390
is finished, we'll actually interrupt Firebolt.

01:11.420 --> 01:15.770
Now it's hard to see and repro at normal speed like this.

01:21.850 --> 01:22.360
There.

01:22.360 --> 01:26.260
I interrupted it even before the fireball was spawned.

01:27.060 --> 01:29.540
Now this is actually a pretty easy fix.

01:29.550 --> 01:33.780
I'm going to show you first though the problem a little bit.

01:33.780 --> 01:34.800
Slow down.

01:34.800 --> 01:39.960
So I'm going to set the cast Firebolt montage to a rate scale of 0.1.

01:39.960 --> 01:42.000
And then I'll go ahead and cast a Firebolt.

01:42.000 --> 01:47.550
And while casting cast the electrocute spell and you'll see that we interrupt it.

01:48.950 --> 01:52.410
So that's not good, but it's a pretty easy thing to fix.

01:52.430 --> 01:55.220
We could go into our.

01:56.220 --> 01:56.930
Blueprints.

01:57.090 --> 01:57.570
Ability.

01:57.600 --> 01:58.520
System.

01:58.530 --> 01:59.090
Aura.

01:59.100 --> 02:01.440
Abilities and fire.

02:01.440 --> 02:02.430
Firebolt.

02:02.670 --> 02:02.940
Gar.

02:03.030 --> 02:03.660
Firebolt.

02:03.660 --> 02:04.350
Spell.

02:04.470 --> 02:09.120
And remember, we have all these gameplay tag containers.

02:09.120 --> 02:12.330
And these allow us to block other abilities.

02:12.330 --> 02:13.080
For example.

02:13.080 --> 02:16.080
So we have a block abilities with tag.

02:16.080 --> 02:22.770
And if we set this to say just abilities, then we would literally block all abilities that have the

02:22.770 --> 02:24.690
abilities tags on them.

02:24.690 --> 02:32.040
So in that case, if I cast, I can spam the right mouse button all day long and even hold it down and

02:32.040 --> 02:37.050
nothing happens until that Firebolt spell is done and we lose that ability tag.

02:38.090 --> 02:45.050
Now blocking all abilities with the abilities tag is a little too broad, so if you wanted to make sure

02:45.050 --> 02:51.470
it's only those offensive spells like fire and lightning spells, you could add the fire.

02:51.500 --> 02:57.490
You could add the lightning tag, and you can block those spells and not block other abilities.

02:57.500 --> 03:01.730
So in this case, we could cast I can spam the right mouse button.

03:01.730 --> 03:08.300
Nothing happens until I lose that abilities fire tag and then I can finally cast.

03:08.330 --> 03:09.620
So that's a way to do it.

03:09.620 --> 03:17.660
And if you wanted to, you could create a specific tag for blocking abilities like a player blocked

03:17.810 --> 03:23.420
offensive spells or something like that, and then all your offensive spells could have that tag, and

03:23.420 --> 03:26.540
then they could all block that tag if you wanted to do that.

03:26.540 --> 03:28.700
But that's just something to keep in mind.

03:28.700 --> 03:34.820
We can always block other abilities that grant specific tags, and this is because we have those tags

03:34.820 --> 03:36.920
in our ability tags container.

03:37.370 --> 03:37.760
Okay.

03:37.760 --> 03:41.750
So I'm going to set the rate scale back to one for Firebolt.

03:41.750 --> 03:47.780
And with that with a quick save we can start thinking about the stun debuff.

03:47.780 --> 03:58.100
Now we already have a stun debuff tag and the ability to apply a debuff, as our attribute set is dynamically

03:58.100 --> 04:00.410
creating and applying a gameplay effect.

04:00.410 --> 04:05.600
If we go into Aura attribute set, we have a debuff function we're calling, and based on the debuff

04:05.600 --> 04:12.380
chance, it's applying a gameplay effect with these debuff parameters, and it's a duration based effect.

04:12.380 --> 04:16.670
So we can apply this using the stun gameplay tag.

04:16.670 --> 04:21.080
And if we do that, then our enemies will be stunned.

04:21.110 --> 04:30.890
So the first step to applying that type of debuff is to go into our lightning to electrocute ability

04:30.890 --> 04:37.160
and make sure that we actually apply that gameplay effect, which means we need to apply damage with

04:37.160 --> 04:40.760
a set by color, magnitude for the stun chance.

04:40.760 --> 04:48.950
And this is actually pretty easy to do now that we've set up a really robust framework because our damage

04:48.950 --> 04:55.340
gameplay abilities already have a debuff chance, I could set that debuff chance to 100 and we can.

04:55.370 --> 04:59.570
For now, just leave a debuff damage and a debuff frequency and duration.

04:59.570 --> 05:07.040
And if we leave these there and we actually assign those set by color magnitudes, we should see our

05:07.040 --> 05:13.490
enemies get Debuffed with the debuff damage type that corresponds to damage lightning.

05:13.520 --> 05:15.380
The question is when do we do it?

05:15.410 --> 05:21.740
Now I didn't want to apply a debuff while we're holding the right mouse button or whatever input button

05:21.740 --> 05:30.410
down, as we're just applying damage here with one set by color magnitude and that is the damage lightning.

05:30.410 --> 05:35.390
So that's the behavior I want while we're holding our input down.

05:35.390 --> 05:40.340
But as soon as we release it, I'd like to apply one last damage amount.

05:40.370 --> 05:47.870
Now, that last damage amount could be the damage amount that we have on our ability.

05:47.870 --> 05:49.280
It could also be zero.

05:49.280 --> 05:53.690
And we could just set our set by color magnitudes for the debuff.

05:54.290 --> 05:59.900
That's an option too, but we need to figure out when we're going to apply that effect.

05:59.900 --> 06:03.990
And that's going to be when we end our ability.

06:04.010 --> 06:06.770
We can go into clear timer and end ability.

06:06.860 --> 06:11.160
And in this function we're removing the gameplay effects.

06:11.180 --> 06:19.550
If we go into prepare to end ability, we go in and we remove the gameplay cue on the actor for our

06:19.550 --> 06:26.510
primary target, and we remove the gameplay cue on actor for the additional targets as well.

06:26.660 --> 06:35.330
What we can do here is we can also apply one final damage gameplay effect, and if we do that we need

06:35.330 --> 06:37.040
damage effect params.

06:37.040 --> 06:44.150
So what we can do is we can call make damage effect params from class defaults.

06:44.150 --> 06:50.660
And the target actor here is actually the target we're trying to apply damage to.

06:50.690 --> 06:51.380
Right.

06:51.380 --> 06:58.790
And if first target implements interface is false, well we're applying this gameplay cue to the avatar

06:58.790 --> 07:00.440
and we don't want to damage the self.

07:00.440 --> 07:06.020
So in this case we don't actually need to apply damage to the avatar actor, do we?

07:06.200 --> 07:12.200
Now if the first target does implement the interface, we can then apply damage to that mouse hit actor

07:12.200 --> 07:14.450
and then to the additional target.

07:14.450 --> 07:16.570
So I'd like to do that.

07:16.580 --> 07:19.880
I'd like to make the damage effect params from class defaults.

07:19.880 --> 07:26.780
And then we can use apply damage effect which is on our Aura Ability system library which takes those

07:26.780 --> 07:28.430
damage effect parameters.

07:28.430 --> 07:32.030
And the target actor here can be the mouse hit actor.

07:32.060 --> 07:35.720
This is really just used to calculate things like death impulse.

07:35.720 --> 07:42.800
And as soon as we've done this, then applying the damage effect to our primary target, we should see

07:42.800 --> 07:46.520
a debuff because our debuff chance is 100%.

07:46.700 --> 07:52.490
Now, after doing that, we remove the shock loop queue from all the additional targets.

07:52.520 --> 07:54.170
We can do the same thing here.

07:54.170 --> 08:01.370
We can duplicate those two nodes, only this time our damage effect params we make will be using this

08:01.370 --> 08:03.530
target, our array element.

08:03.620 --> 08:07.730
And we're going to apply that damage effect to that.

08:07.760 --> 08:12.800
Now if we don't want to do any damage, we could set that damage amount.

08:12.830 --> 08:15.020
We could break this struct.

08:16.260 --> 08:18.030
And we can make a new one.

08:18.060 --> 08:25.290
We can make damage effect params and instead of using our function, we can use just a make damage effect

08:25.290 --> 08:26.010
params.

08:26.010 --> 08:33.330
And if we expand it and we expand this one, we could drag and connect all of these that we want in

08:33.330 --> 08:34.500
our damage effect params.

08:34.500 --> 08:38.310
But we could then override the base damage here.

08:38.490 --> 08:42.600
Now if you don't want to cause any damage then you would stick a zero in there.

08:42.630 --> 08:45.540
I'm actually okay with not doing that.

08:45.540 --> 08:53.040
And then we'll just cause our little one damage at the end for this one last farewell damage amount,

08:53.040 --> 08:53.550
right?

08:56.370 --> 09:01.710
And I'm going to go ahead and try to avoid crossing wires as much as I can.

09:03.440 --> 09:10.310
So for this, just keeping things as organized as I can here.

09:15.320 --> 09:16.550
We'll do this.

09:16.550 --> 09:24.100
And if you do have to cross wires in any circumstance, you could keep those wires as short as possible.

09:24.110 --> 09:28.340
But usually there's a way to avoid crossing wires.

09:31.380 --> 09:33.000
So we could do this.

09:35.870 --> 09:42.470
So if you try hard enough, you should usually be able to avoid crossing those wires.

09:43.190 --> 09:43.850
Okay.

09:44.990 --> 09:50.390
So we're calling applied damage effect now on the primary and additional targets.

09:50.390 --> 09:57.800
And because we're using our damage effect params created with make damage effect params from class defaults.

09:57.830 --> 10:04.150
Those damage effect params will now have a debuff chance, and we're setting it to 100 for now.

10:04.160 --> 10:09.920
So as soon as we release on our electrocute ability, we should see.

10:10.740 --> 10:12.390
What if we don't kill?

10:13.180 --> 10:13.960
The enemy.

10:13.960 --> 10:16.680
We now also have a knockback chance as well.

10:16.690 --> 10:23.710
But yes, now you can see every one second they're getting five damage because they actually have the

10:23.710 --> 10:26.950
debuff associated with electricity, which is stun.

10:27.040 --> 10:35.710
Now, I didn't want a knockback for this ability and I see that my knockback chance is zero.

10:35.860 --> 10:39.640
So I'd like to see where we're using that knockback chance.

10:39.640 --> 10:46.030
I'm going to go into my aura attribute set and search for knockback, and we see that we're getting

10:46.030 --> 10:47.110
our knockback force.

10:47.110 --> 10:51.820
And if it's nearly zero then we're not applying that knockback.

10:51.940 --> 10:55.690
It looks like we're not actually taking that knockback chance into account.

10:55.690 --> 10:58.330
So we could take that chance into account.

10:58.660 --> 11:03.460
Another thing we could do is just have it set to a zero force here.

11:04.080 --> 11:06.660
We're not actually checking the knockback chance.

11:06.660 --> 11:13.470
And in fact, that knockback chance isn't even in the effect context, so we'd have to check it before

11:13.470 --> 11:16.890
we even create those damage effect params.

11:16.980 --> 11:23.760
But in the case of the electrocute ability, we could just set our knockback force magnitude to zero

11:23.760 --> 11:26.340
and then we won't be seeing a knockback force.

11:27.940 --> 11:29.410
So they'll just be sitting there.

11:31.910 --> 11:36.110
So now we're applying a stun debuff.

11:36.230 --> 11:41.450
As soon as our electrocute ability is finished, as soon as we release it.

11:42.030 --> 11:43.170
And that's great.

11:43.170 --> 11:47.030
And of course this will be applied to the additional targets as well.

11:47.040 --> 11:52.380
But as I mentioned, I don't want my stun debuff to cause any damage.

11:52.380 --> 11:56.820
So for my debuff damage I'm going to set that to zero.

11:57.090 --> 12:05.550
And that way if we're applying that debuff, well we don't see any numbers because we're not causing

12:05.550 --> 12:06.600
any damage.

12:06.600 --> 12:08.540
But I want to do something else.

12:08.550 --> 12:17.700
I want to respond to that debuff tag for lightning, which is stun and immobilize the enemy so they

12:17.700 --> 12:18.680
can't move.

12:18.690 --> 12:23.670
I also want to make them show with their animation that they're stunned.

12:24.880 --> 12:27.100
So this will involve a couple of steps.

12:27.100 --> 12:35.650
For one, we need to go into our character folder and into our app enemy, the parent class for all

12:35.650 --> 12:40.450
of our enemy animation blueprints, and we need them to know if they're stunned.

12:40.480 --> 12:42.630
So how do they know if they're stunned?

12:42.640 --> 12:46.120
Well, we could have a stun variable here.

12:46.120 --> 12:54.220
And if we're going to set a stun variable here, then we need a stun variable on the aura enemy class.

12:54.220 --> 12:55.870
And we need to set that.

12:55.870 --> 12:58.480
So a couple of things to do here.

12:58.480 --> 13:02.170
One is to have a stun variable on the at least the enemy class.

13:02.170 --> 13:03.970
We could have one on aura too.

13:03.970 --> 13:06.400
So we could put it on the base character class.

13:06.400 --> 13:14.800
And we also need to respond to a gameplay tag and specifically the stun tag, and set that boolean based

13:14.800 --> 13:15.520
on that.

13:16.240 --> 13:20.470
So let's go ahead and go into our C plus plus project.

13:20.470 --> 13:28.720
And we'll go ahead and start by adding a stun variable on the base character class.

13:29.760 --> 13:36.540
So in the public folder we'll go to character or a character base and we'll add a new Boolean variable.

13:36.600 --> 13:43.440
Now this can be public and we can call this a boolean with the name B is stunned.

13:43.710 --> 13:45.750
It'll be false by default.

13:45.930 --> 13:51.630
Now if we set this on the server we're going to want this to be set on clients as well.

13:51.660 --> 13:54.120
So this should be a replicated variable.

13:54.120 --> 13:57.420
We'll make it uproperty replicated.

13:57.960 --> 14:02.280
And we should also be able to at least read it in blueprint.

14:02.280 --> 14:04.860
So we'll make this blueprint read only.

14:05.220 --> 14:07.770
And now we have a stunned variable.

14:08.190 --> 14:14.220
Now in addition to this we need to respond to receiving the stunned tag.

14:14.760 --> 14:18.060
And I'd like to make a callback function for this.

14:18.240 --> 14:22.110
I'll make it a void function called stun tag changed.

14:22.650 --> 14:31.640
It'll receive a const f gameplay tag called callback tag and an int 32 called New Count.

14:31.650 --> 14:38.230
And we've seen how to respond to these gameplay tags before the callback has to be of this signature.

14:38.280 --> 14:42.940
Strangely, the gameplay tag can't be a const reference, just a const gameplay tag.

14:42.960 --> 14:49.170
We'll go ahead and make this definition here, and we need to make sure to assign this to a delegate

14:49.200 --> 14:51.570
when we've initialized our ability.

14:51.570 --> 14:52.650
Actor info.

14:53.370 --> 14:57.420
Now here we have an ability actor info and it's empty.

14:57.420 --> 15:03.240
And we could put it here so that all of our characters will respond to this tag.

15:03.240 --> 15:09.690
But I'd rather do it in the child classes, because I don't want the success of this to be contingent

15:09.690 --> 15:12.480
on the order that we call super.

15:12.570 --> 15:13.710
Let me show you what I mean.

15:13.710 --> 15:21.630
If I go into to the private folder, into character and or a character, and here in an ability actor

15:21.630 --> 15:30.210
info, if I call super first before my ability system component is a valid pointer, well then if we

15:30.210 --> 15:36.120
assign our callback here to a delegate on the ability system component, that ability system component

15:36.120 --> 15:37.470
won't be valid yet.

15:37.470 --> 15:41.250
And so it would be required for us to call super at the very end.

15:41.250 --> 15:47.400
And that doesn't make our system very robust, because if someone comes in and sees super called at

15:47.400 --> 15:51.600
the end and they say, oh, we should call that at the beginning and then it breaks it, well, that's

15:51.600 --> 15:52.530
a brittle system.

15:52.530 --> 15:54.270
And I don't want our system to be brittle.

15:54.270 --> 15:55.710
I want it to be strong.

15:56.100 --> 16:03.540
So we're going to bind to this delegate only when we know our ability system component has become valid.

16:03.600 --> 16:12.510
So what we'll do here is as soon as our ability system component is valid on aura, we'll take it and

16:12.510 --> 16:15.510
we'll call register gameplay tag event.

16:16.340 --> 16:23.180
Now we have to specify the tag that's going to be for a gameplay tags get.

16:25.130 --> 16:28.280
Dot and it's going to be a debuff.

16:28.430 --> 16:29.120
Tag.

16:29.120 --> 16:38.480
The debuff tag will be stun and for gameplay tag event type, it's going to be new or removed.

16:39.260 --> 16:41.060
And now we have this delegate.

16:41.090 --> 16:48.500
We can go ahead and add a callback to it with add new object using this and the name of the callback.

16:48.500 --> 16:54.440
And the callback is going to be the address of a ora character.

16:54.890 --> 16:57.530
Stun tag changed.

16:58.670 --> 17:05.030
So now we know our aura character will register this, but we want the enemy character to register as

17:05.030 --> 17:05.570
well.

17:05.570 --> 17:07.310
So we'll go to the enemy.

17:07.310 --> 17:12.740
And as soon as the enemy has a valid ability system component, we'll go ahead and.

17:13.760 --> 17:15.680
Do the same exact thing.

17:17.170 --> 17:20.770
Now, instead of a character here, it's going to be.

17:21.450 --> 17:22.380
Our enemy.

17:22.380 --> 17:29.400
And yes, you could just use the base class here, but if we were to override that function, maybe

17:29.400 --> 17:35.250
make it virtual and do something different for a character versus our enemy, well, then we could specify

17:35.250 --> 17:36.270
here which one.

17:36.420 --> 17:42.960
But either way, now we're registering a gameplay tag event and we're registering stun tag changed,

17:42.960 --> 17:45.990
which we have here in our character base.

17:47.060 --> 17:48.500
Stun tag changed.

17:48.500 --> 17:51.520
And what can we do in stun tag changed?

17:51.530 --> 17:53.690
We can do whatever we like.

17:53.690 --> 18:00.530
But what I'd like to do is, first of all, I'd like to immobilize the character.

18:00.560 --> 18:04.370
Now we're immobilizing the character in the hit react, aren't we?

18:04.520 --> 18:06.890
I think we're just doing it in Aura enemy.

18:06.890 --> 18:08.390
Let's find out.

18:08.420 --> 18:15.470
If we look at Hit React, we have hit react tag changed where we check the callback tag, check its

18:15.470 --> 18:17.840
count, and we know we're hit reacting.

18:17.840 --> 18:24.650
If that count is greater than zero and we set character movement, max walk speed, and we have a base

18:24.650 --> 18:28.250
walk speed here that we added to the aura enemy.

18:28.340 --> 18:35.150
And then of course we set the blackboard component, blackboard key hit reacting so we can do something

18:35.150 --> 18:39.440
like this in aura enemy and an aura character base.

18:39.470 --> 18:42.680
We could also set auras max walk speed.

18:42.710 --> 18:46.640
But for aura we don't need to set a blackboard key do we.

18:46.640 --> 18:55.340
So for that reason it might be wise for us to make stun tag change virtual, and then we can have some

18:55.340 --> 19:03.620
basic functionality in the parent version and additional functionality in an override for each child.

19:03.620 --> 19:10.220
So from Aura Enemy, I'm going to copy these two lines and go into Aura Character Base and paste them.

19:10.220 --> 19:17.300
But instead of be hit reacting, we're going to set be is stunned based on this tag.

19:17.390 --> 19:22.100
And then we can check be is stunned and we can set max walk speed.

19:22.100 --> 19:26.120
But base walk speed is just a variable on the enemy class.

19:26.120 --> 19:28.850
But we can move that into aura character base.

19:28.910 --> 19:31.190
So if we search for base walk speed.

19:31.860 --> 19:33.270
We can move that.

19:34.830 --> 19:37.620
And we can move it here into our character base.

19:38.820 --> 19:44.790
We can make it protected and really stun tag change could be protected as well.

19:45.150 --> 19:46.950
So we'll move that here to.

19:48.390 --> 19:48.690
Now.

19:48.690 --> 19:56.610
Base walk speed could be 600 for the default value, but we'll want that a lower value for enemies.

19:56.610 --> 20:00.240
So we can go into Ora enemy and set it in the constructor.

20:00.270 --> 20:03.120
We can say base walk speed equals.

20:03.120 --> 20:06.870
And we had 250 here for enemies.

20:06.870 --> 20:08.940
And that can be set per enemy.

20:08.940 --> 20:12.180
But or a character can get 600.

20:12.270 --> 20:18.450
And the ora character base function here will set our max walk speed to zero.

20:18.450 --> 20:23.130
If we're stunned and set it back to its base walk speed when we're not stunned.

20:23.160 --> 20:24.240
Now get character.

20:24.240 --> 20:26.340
Movement is an incomplete type.

20:26.370 --> 20:27.660
We can include that.

20:27.690 --> 20:29.790
We have it in Ora enemy.

20:29.820 --> 20:31.170
It's right here.

20:31.350 --> 20:35.400
Now we can cut that and we can move it into Ora Character base instead.

20:37.030 --> 20:38.350
So we'll put that here.

20:38.960 --> 20:45.830
So now we're immobilizing the enemy and we're setting B is stunned, which is a replicated variable.

20:46.070 --> 20:48.530
We can use that in our animation blueprint.

20:48.530 --> 20:50.150
So let's go and do that.

20:51.720 --> 20:52.050
Okay.

20:52.050 --> 20:55.590
So our enemy is still using character movement component.

20:55.590 --> 20:57.660
So we'll need to put that back.

20:57.660 --> 21:00.420
So we're keeping it here in our character base.

21:00.660 --> 21:03.870
But we'll also keep it in the enemy class as well.

21:05.590 --> 21:12.670
And of course, before we test this out, let's go into our character base, because now that we're

21:12.670 --> 21:20.110
replicating a variable, B is stunned, our or a character base needs to have git lifetime replicated

21:20.110 --> 21:21.460
props, doesn't it?

21:21.460 --> 21:24.550
So we're going to put that just below the constructor.

21:26.560 --> 21:31.540
We'll have get lifetime replicated props.

21:32.200 --> 21:33.970
This takes a T array.

21:35.520 --> 21:39.330
Of f lifetime property.

21:40.220 --> 21:42.320
By reference and it's out.

21:42.350 --> 21:44.120
Lifetime props.

21:46.400 --> 21:50.210
All of this has to be exactly typed like this, by the way.

21:50.240 --> 21:53.660
You cannot change out lifetime props.

21:53.660 --> 21:55.640
You cannot have an uppercase T there.

21:55.670 --> 21:57.440
This all has to be exact.

21:57.560 --> 22:00.170
We'll go ahead and generate the definition.

22:00.170 --> 22:09.080
And in this function we need to use do rep lifetime specifying a or a character base.

22:09.800 --> 22:12.920
And the variable b is stunned.

22:13.680 --> 22:20.040
And if we want to use do rep lifetime, we have to include net slash unreal network dot h.

22:22.260 --> 22:25.140
So with that, let's go back into the editor.

22:26.270 --> 22:28.520
I'll go ahead and open what we had open.

22:28.520 --> 22:37.090
And here in App Enemy, we're going to want to access that stunned variable from the enemy class.

22:37.100 --> 22:43.970
So right here as we cast to Ora enemy, if we dragged off of this and type stun we can get as stunned.

22:43.970 --> 22:46.160
But we need this every frame.

22:46.160 --> 22:50.030
So we're going to have to take ora enemy and promote this to a variable.

22:50.030 --> 22:52.670
We'll call this Ora enemy.

22:56.150 --> 22:57.320
And hook that up.

22:57.320 --> 23:00.590
And now that we have this, we can get this here.

23:03.230 --> 23:05.150
We'll use a sequence node now.

23:05.770 --> 23:07.630
And we'll get our enemy down here.

23:07.630 --> 23:09.640
I'm going to make it a validated get.

23:13.430 --> 23:15.300
Now we're going to type in stun.

23:15.320 --> 23:20.180
Get is stunned and promote this to a variable called stunned.

23:21.970 --> 23:28.580
And we'll set this every frame, and we need to change our pose based on if we're stunned.

23:28.600 --> 23:31.720
So in our anim graph.

23:33.690 --> 23:36.390
I'm going to open that and go into main states.

23:36.420 --> 23:38.130
We have idle walk, run.

23:38.220 --> 23:41.100
Now I'm going to have a stun state.

23:41.100 --> 23:46.320
So I'm going to add a state and call this stun or stunned.

23:48.480 --> 23:55.650
And we'll transition into this state if our stunned variable is true, and we'll transition back if

23:55.650 --> 23:57.330
the stun variable is false.

23:57.360 --> 23:58.470
Pretty simple.

24:00.340 --> 24:03.970
So we'll have a not ball and hook that in.

24:04.830 --> 24:08.760
And for stunned, we need a sequence player.

24:11.470 --> 24:13.150
And we'll hook that in there.

24:13.300 --> 24:15.070
We'll compile and save.

24:15.100 --> 24:21.850
And now it's just up to our child animation blueprints based on this to set that sequence player so

24:21.850 --> 24:23.730
we can start with our goblin.

24:23.740 --> 24:25.170
We'll go to Goblin.

24:25.180 --> 24:27.520
Here's our goblin slingshot.

24:27.700 --> 24:30.340
And we can go to Asset Override.

24:30.340 --> 24:31.330
Expand these.

24:31.330 --> 24:32.770
And here's our stunned.

24:32.800 --> 24:34.660
We can set the sequence here.

24:34.660 --> 24:37.330
And I'm going to search for stun.

24:37.420 --> 24:40.090
And we have a slingshot stun loop.

24:40.210 --> 24:42.250
Where in the Goblin slingshot.

24:42.250 --> 24:43.720
So we'll set that there.

24:48.670 --> 24:51.900
And compile and save and close.

24:51.910 --> 24:53.440
And we'll do this for the next one.

24:53.440 --> 24:58.900
So we're going to go to character Goblin Spear app Goblin Spear.

24:58.900 --> 25:02.080
And we'll set that asset override for stunned.

25:02.920 --> 25:04.390
I'm going to search for stun.

25:04.390 --> 25:07.030
And we have a stun loop for Goblin Spear.

25:07.030 --> 25:13.330
And by the way, if you want to take a look at these, here's the stun loop for Goblin Spear.

25:15.560 --> 25:21.110
And here's the stun loop for the slingshot goblin so they look nice and stunned.

25:22.530 --> 25:24.870
Okay, so that is for Goblin Spear.

25:24.870 --> 25:28.530
We can go back and let's go ahead and do the shaman.

25:28.920 --> 25:31.530
So here's a shaman.

25:31.620 --> 25:34.140
We'll go ahead and set that for the shaman.

25:34.140 --> 25:36.660
I'm going to search for stun and we have shaman stun.

25:36.660 --> 25:39.000
We can go to that and see what that looks like.

25:39.000 --> 25:40.200
And here's the shaman.

25:40.200 --> 25:41.100
Stunned.

25:41.400 --> 25:43.080
Nice and stunned.

25:44.980 --> 25:46.780
After that, we can go to.

25:46.780 --> 25:48.190
Let's do the ghoul next.

25:48.220 --> 25:53.710
AVP ghoul, and we'll set the asset override here for stunned searching for stun.

25:53.710 --> 25:56.920
And here's a stun animation.

25:57.620 --> 25:59.930
And here's what it looks like.

26:01.000 --> 26:02.190
Nice and stunned.

26:02.200 --> 26:03.070
Kind of sleeping.

26:03.070 --> 26:03.850
Almost.

26:05.610 --> 26:07.230
Okay, that's the goal.

26:07.230 --> 26:09.930
And the last one we can do is our demon.

26:10.970 --> 26:15.950
So we'll go into the demon animation blueprint and override the asset for stunt.

26:15.980 --> 26:19.490
Here I'm going to search for stun, and there's a demon stun.

26:20.410 --> 26:22.960
And here's the demon stunned animation.

26:24.630 --> 26:32.640
Okay, so now that we have those in our animation blueprints, all we need to do really is test it out.

26:32.670 --> 26:36.510
But let's do this for aura while we're at it.

26:36.540 --> 26:43.800
We'll go to Content Blueprints, Character Aura, app aura, and we'll just take care of the stun loop

26:43.800 --> 26:45.290
for aura as well.

26:45.300 --> 26:49.010
So we'll just have a stun state here.

26:49.020 --> 26:52.200
And aura does have a stun animation.

26:52.200 --> 26:56.100
If we go to that, here's what Aura Stun looks like.

26:56.810 --> 26:59.270
Nice and sleepy and stunned.

26:59.300 --> 27:01.240
Now for stun.

27:01.250 --> 27:06.590
I'm just going to make a boolean here on our animation blueprint.

27:06.620 --> 27:09.440
We're going to get our character.

27:09.560 --> 27:11.300
We're going to add a pin here.

27:11.390 --> 27:16.250
We're going to get this app character and type stun.

27:16.580 --> 27:18.200
We'll go ahead and get is stunned.

27:18.200 --> 27:20.540
And we'll promote this to a variable as well.

27:21.340 --> 27:22.780
We'll call it stunned.

27:24.680 --> 27:25.940
And we'll hook that in.

27:27.220 --> 27:31.930
And then we can just check this, just like we're checking our in shock loop.

27:31.930 --> 27:34.270
So we'll have stun here.

27:34.270 --> 27:36.490
And I'll just have one going back to idle.

27:36.490 --> 27:38.170
And this will check stunned.

27:38.380 --> 27:41.230
And we'll say not boolean.

27:41.350 --> 27:45.580
And if we're not stunned we'll go back to idle.

27:45.580 --> 27:50.350
And then we can have a state alias going to stun.

27:50.350 --> 27:54.040
We'll call it to stun and go into stunned.

27:54.040 --> 27:56.830
And this will be if stun becomes true.

27:56.830 --> 28:00.070
And what states do we want to go to stunned.

28:00.100 --> 28:01.570
Well, we'll go to stunned.

28:01.600 --> 28:02.680
If we're idle.

28:02.860 --> 28:09.520
We'll go to stunned if we're in air and the cast shock loop, or if we're running.

28:09.520 --> 28:13.750
So we can basically get stunned if we're in any of those states.

28:14.880 --> 28:16.350
So that'll handle that.

28:18.560 --> 28:21.140
Okay, so we can stun one of our enemies.

28:23.590 --> 28:23.980
Okay.

28:23.980 --> 28:26.950
So it is going into that stun.

28:26.950 --> 28:33.930
But it played the hit react and it finished the hit react animation first before going into the stun.

28:33.940 --> 28:38.830
So that was a bit of a wait that we had to do.

28:42.500 --> 28:46.040
And then going into the stunt animation was a bit abrupt.

28:46.040 --> 28:52.790
So I'd like to go back to the AVP enemy anim graph two main states and into our stunned.

28:52.790 --> 28:56.780
And the duration for this transition could be a little bit longer.

28:58.040 --> 29:01.010
So it sort of blends a little bit better.

29:05.640 --> 29:10.530
And in addition to that, I'd like my hit react montage to be a little faster.

29:10.530 --> 29:13.950
So I'm going to go to assets enemies.

29:15.200 --> 29:21.710
Goblin animations spear and we'll go to M hit react Goblin spear.

29:22.720 --> 29:29.320
And I think I'd actually like this animation cut a little bit.

29:30.830 --> 29:34.010
So I'm going to take my hit react spear.

29:34.130 --> 29:36.320
I'm going to duplicate it first.

29:38.060 --> 29:43.550
This is just a tweak, but I'm going to duplicate and call this hit react spear underscore cut.

29:43.910 --> 29:45.860
And I'm going to cut this short.

29:48.280 --> 29:49.450
To about here.

29:50.190 --> 29:53.010
So I'm going to remove from frame 28 to 42.

29:55.310 --> 29:59.090
Now, I do want this animation to be a root motion animation.

29:59.090 --> 30:01.100
I'm going to enable root motion.

30:03.280 --> 30:07.620
And then I'll go to the montage and I'll add this cut animation to it.

30:10.220 --> 30:12.350
And delete the old one from it.

30:14.290 --> 30:16.030
So it's a little faster now.

30:18.030 --> 30:19.110
Let's try this.

30:21.590 --> 30:22.700
Okay, that's better.

30:22.700 --> 30:27.430
And I'm just going to see if my slingshot hit react needs to change too.

30:27.440 --> 30:30.350
So I'm going to go to Goblin.

30:31.140 --> 30:35.700
Animation slingshot and go to the hit react.

30:37.390 --> 30:39.130
I think this one's actually fine.

30:39.130 --> 30:41.560
So I'll leave those as is.

30:41.830 --> 30:46.570
And now, whenever they're stunned, we see that stun.

30:46.570 --> 30:49.840
And after five seconds it should go back to not stunned.

30:49.990 --> 30:56.710
So something we need to do is make sure from the behavior tree standpoint, that our enemies can't do

30:56.710 --> 30:59.180
anything if they're stunned.

30:59.200 --> 31:00.580
We don't want them to move.

31:00.610 --> 31:02.140
We don't want them to attack.

31:02.140 --> 31:04.270
So we can go into our behavior tree.

31:04.270 --> 31:08.660
And just like we're checking, am I not hit reacting before doing anything else?

31:08.680 --> 31:11.890
We can also check if we're stunned.

31:11.890 --> 31:18.250
And for that reason, I'd like to go to the blackboard and add a new key called stunned.

31:19.860 --> 31:21.150
We'll go ahead and save.

31:21.150 --> 31:24.950
And right here next to me not hit reacting.

31:24.960 --> 31:29.340
We're going to right click on the selector add decorator.

31:29.340 --> 31:30.660
Choose blackboard.

31:30.660 --> 31:35.130
And for this blackboard based condition we're going to do the same thing that we did here.

31:35.130 --> 31:37.080
And am I not hit reacting.

31:37.080 --> 31:40.710
We'll do a notify the observer on value changed.

31:41.040 --> 31:42.540
So we'll change that.

31:42.690 --> 31:45.330
We'll use observer abort self.

31:46.220 --> 31:47.780
So we'll change that.

31:48.640 --> 31:51.790
We'll use key query is not set.

31:52.440 --> 31:54.870
So key query is not set.

31:55.140 --> 31:57.270
And we'll choose the blackboard key.

31:57.300 --> 31:58.290
Stunned.

31:58.870 --> 32:01.180
And we'll change the node name to.

32:01.910 --> 32:04.880
Am I not stunned?

32:05.210 --> 32:06.260
Question mark.

32:07.360 --> 32:09.730
And then we can just set the stunt tag.

32:11.140 --> 32:13.600
And I'm going to set that from C plus plus.

32:14.910 --> 32:15.510
In stun.

32:15.540 --> 32:15.810
Tag.

32:15.810 --> 32:17.000
Changed in aura.

32:17.010 --> 32:17.640
Enemy.

32:18.680 --> 32:24.120
And I'd like to set this blackboard key just like we did in Ora enemy and hit react.

32:24.140 --> 32:26.900
Tag changed when we did it for hit reacting.

32:26.900 --> 32:30.890
We'll do the same thing for the stun tag, which means an ora enemy.

32:30.890 --> 32:38.240
We should override stun tag changed, so we'll say Virtualvoid stun tag change will override this function.

32:38.240 --> 32:40.130
We'll generate the definition.

32:41.600 --> 32:44.930
And we'll do what we did and hit react tag change.

32:44.930 --> 32:51.710
Namely, we'll go ahead and change a blackboard key with set value as bool.

32:51.740 --> 32:56.780
Now we still want to call super because that's going to take care of the max walk speed.

32:56.840 --> 33:04.430
But we're also going to want to set value as bool for the stun blackboard key.

33:05.000 --> 33:06.530
I think it's called stunned.

33:06.560 --> 33:07.910
We'll have to double check.

33:08.090 --> 33:10.400
And what are we going to set it to.

33:10.430 --> 33:12.010
Well we need to check new count.

33:12.020 --> 33:17.090
In fact we already set that in stun tag changed and or a character base we set.

33:17.120 --> 33:18.260
B is stunned here.

33:18.260 --> 33:20.360
So we could just use B as stunned.

33:21.010 --> 33:22.060
Right here.

33:22.150 --> 33:26.230
We'll set the stun tag to be is stunned.

33:27.390 --> 33:29.670
So we can compile and check this out.

33:30.800 --> 33:35.000
So I'm going to open my assets.

33:35.000 --> 33:37.270
I actually don't need an aura.

33:37.310 --> 33:39.230
I'll keep electrocute open.

33:39.230 --> 33:45.890
I'll close app enemy and we'll open our behavior tree where we set.

33:45.920 --> 33:47.030
Am I not stunned?

33:47.060 --> 33:48.740
I'm going to open this behavior tree.

33:48.740 --> 33:55.340
I'm going to keep it open and just show the value of that blackboard key for stunned.

33:57.230 --> 33:58.400
Right here.

34:00.000 --> 34:02.400
And I'll stun the enemy.

34:03.080 --> 34:08.270
And we'll see if that stunned blackboard key gets set to true.

34:08.690 --> 34:10.760
So I can just barely see it right here.

34:10.760 --> 34:12.020
It's set to false.

34:13.450 --> 34:18.790
Now I see that it's set to true, and it should stay true for five seconds and go back to false.

34:18.820 --> 34:19.400
Good.

34:19.420 --> 34:22.300
Now let's see if we're preventing movement.

34:22.420 --> 34:24.040
While that is true.

34:26.080 --> 34:27.610
And it looks like.

34:28.470 --> 34:30.870
We are and as soon as it goes back.

34:31.820 --> 34:33.500
It can then attack again.

34:34.330 --> 34:36.220
Until then, it can't do anything.

34:36.220 --> 34:37.090
It's stunned.

34:39.080 --> 34:40.550
That's what I wanted to see.

34:40.580 --> 34:45.440
Now, we do have to keep in mind that we duplicated this behavior tree, and we have a different one

34:45.440 --> 34:47.270
for elementalist enemies.

34:47.270 --> 34:50.450
So they're going to need their own decorator.

34:50.450 --> 34:50.890
Here.

34:50.900 --> 34:53.630
They have a stunned because they're using the same blackboard.

34:53.630 --> 34:55.940
And the blackboard is a separate asset.

34:55.940 --> 35:01.910
So as soon as we added stun to our blackboard well our elementalist behavior tree is using that.

35:01.910 --> 35:06.740
But we do need to add a decorator choosing blackboard and set this.

35:06.740 --> 35:09.200
We're going to set it to on value changed.

35:10.110 --> 35:14.040
Observer aboard self key query is not set.

35:14.070 --> 35:18.060
Blackboard key stunned and the node name will be.

35:19.890 --> 35:22.380
Am I not stunned.

35:23.730 --> 35:26.890
And now our shaman should behave as well.

35:26.910 --> 35:30.780
So with that, we have a working stun mechanic.

35:31.230 --> 35:32.700
So that debuff works.

35:32.700 --> 35:35.690
We can have it cause damage if we like.

35:35.700 --> 35:40.740
And the last thing I could try is to make sure this works on aura.

35:40.770 --> 35:44.490
So what we can do is we can take this enemy.

35:44.910 --> 35:47.190
We know that the enemy is actually.

35:47.190 --> 35:48.960
Let's check its character class.

35:48.960 --> 35:52.920
I think it's set to Ranger because it's launching rocks, which it shouldn't.

35:54.180 --> 35:55.920
That's because it is set to Ranger.

35:55.920 --> 36:01.920
We can set it to warrior, actually, and then we can change the melee gameplay ability.

36:01.950 --> 36:09.930
We can change its damage type so we can go to ability system, enemy abilities, melee attack.

36:09.930 --> 36:18.180
And if we change its damage type to lightning and we change its debuff chance to 100, then we should

36:18.180 --> 36:21.030
see that aura will be stunned.

36:21.030 --> 36:25.640
And since there's a debuff damage of five, she'll take damage while she's stunned as well.

36:25.650 --> 36:27.750
Let's just see if that works.

36:30.330 --> 36:31.680
And she's stunned.

36:31.680 --> 36:33.930
And while we can.

36:34.930 --> 36:35.630
Rotate.

36:35.650 --> 36:37.360
We actually can't move.

36:40.140 --> 36:43.110
So we don't want aura to be able to rotate.

36:43.720 --> 36:45.520
But other than that, we can't move.

36:45.520 --> 36:47.230
Let's see if we can cast spells.

36:48.490 --> 36:55.210
We can cast spells, so we want to block any spells while we're stunned as well.

36:55.210 --> 36:58.960
So two things to fix really quick.

36:59.230 --> 37:08.170
We'll go to ability system, aura abilities fire, Firebolt Firebolt and we're going to add a tag to

37:08.170 --> 37:10.000
activation block tags.

37:10.000 --> 37:13.150
We're going to add the stun debuff tag.

37:13.150 --> 37:14.770
So debuff.

37:15.980 --> 37:20.390
Stun and we shouldn't be able to launch a Firebolt while stunned.

37:20.420 --> 37:24.440
We'll do the same thing for abilities lightning electrocute.

37:24.440 --> 37:26.590
So activation block tags.

37:26.600 --> 37:30.230
We're going to add debuff stun here.

37:30.320 --> 37:33.710
And now if we're stunned, we shouldn't be able to cast those spells.

37:36.010 --> 37:36.760
Okay.

37:36.760 --> 37:40.720
And we're not able to cast those spells.

37:41.580 --> 37:42.960
And we are when we're done.

37:42.960 --> 37:46.530
And I noticed that the stun animation was not looping.

37:46.680 --> 37:51.900
So a couple little things that pop up here and there when implementing new things, right?

37:52.600 --> 37:58.130
Let's go to Ora's Animation Blueprint and go to the stun state.

37:58.150 --> 38:00.040
Take that stun sequence.

38:00.840 --> 38:03.290
Player and set it to loop animation.

38:03.300 --> 38:04.710
That'll fix that.

38:04.950 --> 38:10.050
And how are we going to prevent aura from being able to.

38:11.160 --> 38:12.330
Move around.

38:16.820 --> 38:24.620
Well, we do have the ability to block input because we created some tags to block input.

38:24.650 --> 38:25.670
Remember.

38:25.670 --> 38:31.130
And or a player controller we're checking those in player or a player controller.

38:31.130 --> 38:38.180
We're checking before even doing anything in ability input tag pressed and the other associated functions.

38:38.180 --> 38:40.700
We're checking player block input pressed.

38:40.730 --> 38:49.100
We could easily give that tag when debuffed if the debuff is the stun type, and it will be removed

38:49.100 --> 38:52.610
when the stun debuff is removed.

38:52.640 --> 38:55.910
That would be something we do in the aura attribute set.

38:56.300 --> 39:04.040
If we look for our debuff function right here, we can add it to inheritable own tags container and

39:04.040 --> 39:07.640
we can check the damage type or the debuff type either one.

39:07.640 --> 39:14.360
So if we say if and we can get that debuff type that's this right here.

39:14.360 --> 39:16.370
So we could paste that whole thing in here.

39:16.370 --> 39:25.460
We could also just do a const gameplay tag called debuff tag and set it equal to this.

39:29.240 --> 39:31.700
And then use debuff tag here.

39:32.940 --> 39:35.190
And then we can check the tag here.

39:35.190 --> 39:46.790
If debuff tag matches tag exact, and we can check to see if it matches F or a gameplay tags get debuffs

39:46.860 --> 39:47.190
done.

39:47.370 --> 39:52.140
If it does, then we'll also add two inheritable owned tags.

39:52.140 --> 39:53.070
Container.

39:53.100 --> 40:01.170
What tag we're going to add for a gameplay tags get.

40:02.540 --> 40:06.110
Player block and we can block any number of these.

40:06.110 --> 40:08.240
Input pressed input released.

40:08.240 --> 40:09.110
Input held.

40:09.140 --> 40:10.490
We could add all three.

40:11.780 --> 40:15.830
We could even block the cursor trace while we're stunned.

40:15.860 --> 40:18.320
Why don't we add all four of these block tags?

40:19.450 --> 40:25.150
And since we're going to use this for a gameplay tags get multiple times, I'm going to go ahead and

40:25.150 --> 40:29.950
also make a const or a gameplay tags.

40:30.890 --> 40:32.900
Reference called gameplay tags.

40:36.320 --> 40:38.630
Looks like I already did up here.

40:39.080 --> 40:41.480
So that's actually unnecessary.

40:42.960 --> 40:50.190
And I'll just use gameplay tags instead of get right there and right here.

40:52.480 --> 40:57.610
And while we're adding our block cursor trace we'll add the other three.

40:57.610 --> 40:58.990
We'll add block.

41:00.910 --> 41:02.050
Input held.

41:02.080 --> 41:03.610
We'll add block.

41:08.460 --> 41:12.180
Input pressed and finally we'll add.

41:13.930 --> 41:15.820
Block input released.

41:17.470 --> 41:22.060
Now with that, if we're stunned, we can even add input.

41:22.090 --> 41:23.290
Let's test that.

41:24.910 --> 41:27.760
The stunt mechanic is so frustrating, isn't it?

41:27.790 --> 41:29.650
You can't do anything while you're stunned.

41:29.680 --> 41:30.910
Let's try that out.

41:32.950 --> 41:33.640
There we go.

41:33.640 --> 41:34.330
And I'm clicking.

41:34.330 --> 41:34.870
I'm moving.

41:34.870 --> 41:35.860
I'm trying things.

41:35.860 --> 41:37.060
I can't do anything.

41:37.060 --> 41:42.130
And as soon as it's done, I can move, I can click, I can do all the stuff I want to do.

41:43.200 --> 41:48.180
So now we have a working stun mechanic and it should work in multiplayer.

41:48.210 --> 41:50.250
Let's try it with two players.

41:50.550 --> 41:51.930
I'll save all.

41:52.350 --> 41:53.520
Press play.

41:53.910 --> 41:55.740
And here on the client.

41:58.040 --> 41:59.660
We'll try getting stunned.

42:01.190 --> 42:06.020
Oh, it looks like we are able to do things and we're getting rubber banding because on the server it's

42:06.020 --> 42:06.800
prevented.

42:06.830 --> 42:08.600
On the client it's not.

42:08.600 --> 42:13.610
So we do want to make sure that we get those tags.

42:14.670 --> 42:21.930
So we've already seen that these dynamic gameplay effects we create in C plus Plus are not replicated.

42:22.110 --> 42:24.990
And that means their tags are not replicated.

42:25.020 --> 42:30.390
But one thing we are doing in our character base is we're setting B is stunned, which is a replicated

42:30.390 --> 42:31.200
variable.

42:31.470 --> 42:35.910
Now that's really useful because we can have a rep notify.

42:36.090 --> 42:43.200
So if we have a rep notify then on the client when B is stunned replicates, we could either add or

42:43.200 --> 42:45.180
remove those block tags.

42:45.450 --> 42:49.890
So I'm going to add a rep notify and just make it virtual.

42:49.890 --> 42:57.060
So in or a character base B is stunned is now going to say replicated using equals.

42:57.060 --> 43:01.750
And we'll make an on rep underscore stun or stunned.

43:01.770 --> 43:07.730
And we can create that rep notify void on rep underscore stunned.

43:07.740 --> 43:10.790
And it has to be a new function to be a rep notify.

43:10.800 --> 43:18.360
And we can implement on rep stunned which will only be called on clients when B is stunned is replicated.

43:18.360 --> 43:24.480
And with that we can add or remove those tags to the ability system component.

43:24.480 --> 43:29.220
And then our player state will know not to allow input.

43:29.520 --> 43:32.010
Now I only want to do this on a character.

43:32.010 --> 43:35.580
So I'm going to make on rep stunned virtual.

43:36.600 --> 43:39.360
And I'm going to override it and or a character.

43:40.230 --> 43:42.900
So we'll say virtual void on rep.

43:42.900 --> 43:43.920
Stunned.

43:44.760 --> 43:47.250
Override and we'll set it here.

43:48.290 --> 43:49.420
And here in on rep.

43:49.430 --> 43:49.820
Stunned.

43:49.820 --> 43:51.190
I'm not going to call super.

43:51.200 --> 43:53.600
I'm going to get our ability system component.

43:54.720 --> 43:55.790
Cast to you.

43:55.800 --> 43:56.640
Ora ability.

43:56.640 --> 43:57.960
System component.

43:59.340 --> 44:05.430
Our ability system component store that in a local variable called Ora asc.

44:07.780 --> 44:09.700
Wrap that in an if statement.

44:12.170 --> 44:13.970
And then take a risk.

44:16.190 --> 44:19.400
And add gameplay tag.

44:19.760 --> 44:25.880
We can even just call add loose gameplay tag and pass in a gameplay tag container, which we can create

44:25.880 --> 44:26.540
here.

44:29.570 --> 44:31.910
And we'll call this blocked tags.

44:32.450 --> 44:34.460
And blocked tags.

44:36.300 --> 44:49.110
Can have a tag added which will be for gameplay tags get dot player, block, cursor trace and all the

44:49.110 --> 44:51.150
other associated tags.

44:54.390 --> 44:59.010
So I'll make a const f or a gameplay tags called gameplay tags.

45:00.180 --> 45:01.920
This could be a const ref.

45:04.720 --> 45:06.160
And we'll use that here.

45:06.910 --> 45:12.430
And we'll also take blocked tags and we'll add the other blocked tags.

45:15.870 --> 45:17.160
Input held.

45:22.860 --> 45:24.180
Input pressed.

45:27.480 --> 45:29.100
And input released.

45:29.850 --> 45:34.200
Now we only want to add these if be stunned is true.

45:34.500 --> 45:39.510
So if be stunned then we're going to add these gameplay tags.

45:40.290 --> 45:45.300
So we're going to say add block tags like so.

45:46.010 --> 45:51.050
But in the case we're going to remove these gameplay tags.

45:54.640 --> 45:59.320
And we're going to use remove loose gameplay tags passing in blocked tags.

45:59.920 --> 46:03.520
Now notice there were replicated versions of these.

46:03.520 --> 46:09.870
So ora ask add replicated loose gameplay tag.

46:09.880 --> 46:15.340
You could use that if you want to use replication, but doing it this way we're only replicating one

46:15.340 --> 46:21.250
little boolean and not those tag containers, so it's a little bit more optimized this way.

46:21.280 --> 46:28.330
So with that change, we can try to restart instead of closing the editor or hitting stop and then running

46:28.330 --> 46:33.370
in debug again, I can just click this rerun here and writer, and that will go ahead and close the

46:33.370 --> 46:36.070
editor down and run in debug mode again.

46:36.070 --> 46:37.720
It'll recompile and all that.

46:37.720 --> 46:41.560
So just a little shortcut I use sometimes as well.

46:43.060 --> 46:43.540
All right.

46:43.540 --> 46:46.630
So let's try this with two players.

46:46.630 --> 46:48.100
We'll try it on the client.

46:49.360 --> 46:50.740
I'll go ahead and get hit.

46:54.010 --> 46:56.290
And I'm not able to move.

46:56.320 --> 46:58.540
Let's see if I can move again when it's removed.

46:58.540 --> 46:59.620
And yes, I can.

47:00.040 --> 47:02.860
So we can add those gameplay tags manually.

47:02.860 --> 47:07.030
And then as long as those tags are on our character, we can't do anything.

47:07.030 --> 47:12.340
We can try this on the server as well just to make sure everything works as expected.

47:12.340 --> 47:13.180
Input is blocked.

47:13.180 --> 47:19.120
I'm spamming these keys and as soon as I'm not stunned anymore, things work.

47:19.120 --> 47:22.000
Now the last thing I want to try is on the client.

47:22.000 --> 47:23.920
Let's try stunning this enemy.

47:28.460 --> 47:34.760
And when I release the mouse button, I don't stop my electric ability.

47:40.120 --> 47:42.970
And it's only if I release really fast.

47:48.130 --> 47:53.110
So we'll fix that issue in the next video and we'll also polish up stun.

47:53.140 --> 47:55.390
So great job and I'll see you soon.
