WEBVTT

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

00:08.240 --> 00:12.020
Now here's our cursor trace in our cursor trace.

00:12.020 --> 00:14.990
As long as we're not blocked from highlighting.

00:14.990 --> 00:21.710
If our ability system component doesn't have player block cursor trace as a tag, then we're performing

00:21.710 --> 00:28.250
our line trace and checking to see if the hit actor implements the highlight interface.

00:28.700 --> 00:35.120
We're casting to the eye highlight interface here, and if the hit actor successfully casts to that,

00:35.120 --> 00:37.430
this actor will be non-null.

00:37.430 --> 00:40.490
And we can of course call highlight and unhighlight on it.

00:41.030 --> 00:46.040
Now, if this actor isn't null, then an ability input tag pressed.

00:46.040 --> 00:53.570
We're setting a boolean called Be Targeting and be targeting is set to true if this actor is non null

00:53.570 --> 00:55.160
and false otherwise.

00:55.160 --> 01:00.410
And that way we know when we press the left mouse button whether we should auto run to that location

01:00.410 --> 01:05.090
or whether we should cast a spell targeting this actor.

01:05.090 --> 01:11.540
Now that this actor is a highlight interface and not an enemy interface, things are a little different.

01:11.570 --> 01:12.230
Now.

01:12.260 --> 01:19.370
We need to know if we're targeting an enemy or if we're targeting, say, anything else that we're highlighting.

01:19.370 --> 01:21.950
That's not an enemy, a non enemy.

01:21.950 --> 01:28.190
We'll say one of the things I'd like to be able to hover over is a map entrance, something that takes

01:28.190 --> 01:29.540
us to another map.

01:30.080 --> 01:35.960
So I don't want to have to create a boolean for each type of thing that we can highlight over.

01:35.960 --> 01:37.730
That's kind of silly.

01:37.910 --> 01:42.680
It would be better to have one variable that can have multiple states, like an enum.

01:42.680 --> 01:48.470
So I'd like to have a sort of targeting status instead of a boolean be targeting.

01:48.470 --> 01:54.290
And that way we can have targeting enemy targeting map entrance, something like that.

01:54.500 --> 01:59.030
So for that reason I'm going to make an enum in or a player controller.

02:00.220 --> 02:04.780
Now, this doesn't need to be exposed to blueprint or the reflection system.

02:04.780 --> 02:06.850
It can be a plain old enum.

02:08.230 --> 02:13.360
So I'm going to make an enum called E targeting status.

02:13.810 --> 02:18.550
And E targeting status can be targeting enemy.

02:19.060 --> 02:25.270
It can be targeting map entrance and it can be not targeting.

02:26.470 --> 02:30.490
So we're hovering over something that's not implementing the highlight interface at all.

02:30.490 --> 02:34.540
And then the other two are targeting enemy and targeting map entrance.

02:34.600 --> 02:38.290
Allow us to do different things depending on what we're hovering over.

02:38.710 --> 02:44.530
So we're going to need an E targeting status instead of a B targeting boolean.

02:45.040 --> 02:47.170
So I'm going to find B targeting.

02:47.530 --> 02:48.580
Here it is.

02:48.580 --> 02:54.460
And we're going to replace it with an E targeting status called targeting status.

02:55.920 --> 03:02.850
And targeting status can be set to not targeting as its default value, and we can completely remove

03:02.880 --> 03:04.740
be targeting altogether.

03:05.280 --> 03:11.880
That means we have to go into the player controller where we're using targeting and set it and use it

03:11.880 --> 03:12.870
appropriately.

03:12.900 --> 03:18.540
Now, as soon as ability input tag is pressed, if it's the left mouse button, we're checking this

03:18.540 --> 03:20.160
actor to see if it's null.

03:20.160 --> 03:25.620
Right now this is a highlight interface, so it could be an enemy, but it could be any other actor

03:25.620 --> 03:27.720
that implements the highlight interface.

03:27.900 --> 03:31.620
So we need to know if we're hovering over an enemy or not.

03:31.920 --> 03:36.510
So what we can do is we can see if this actor is an enemy.

03:36.540 --> 03:39.480
Now this actor is a I highlight interface.

03:39.480 --> 03:42.120
This is an I highlight interface object.

03:42.540 --> 03:46.410
Now we could perform an up cast, but that's not really good practice.

03:46.410 --> 03:49.320
We don't really want to take an interface of type.

03:49.320 --> 03:52.380
I highlight interface and cast to an I enemy interface.

03:52.380 --> 03:55.080
That's messy and it's not what I want to do.

03:55.590 --> 03:59.610
Now we can do something else instead in our cursor trace.

03:59.610 --> 04:06.450
Let's just say that this actor and last actor are simply actor pointers.

04:08.030 --> 04:14.510
If we make them actor pointers, then at any point in time we can check to see if they highlight a given

04:14.510 --> 04:15.350
interface.

04:15.980 --> 04:18.830
And we can always call interface functions on them.

04:19.400 --> 04:25.310
Now if we go that route, we can make highlight and Unhighlight blueprint native events so we can call

04:25.310 --> 04:27.410
their static execute versions.

04:27.740 --> 04:32.540
And then we don't have to do this business of casting to an I highlight interface here in C plus.

04:32.540 --> 04:35.120
Plus it's not that expensive of an operation.

04:35.120 --> 04:38.270
It's totally fine that we do this every frame.

04:38.270 --> 04:43.340
But now that I'd like last actor in this actor to just be actor pointers.

04:43.830 --> 04:49.110
That makes it easier further down the line to check this actor for any interface.

04:49.760 --> 04:53.540
So let's do a little bit of a rearrangement here.

04:53.570 --> 04:56.780
First of all I'm going to go into highlight interface dot h.

04:56.780 --> 05:03.110
And instead of being pure virtual functions I'm going to make these blueprint native events.

05:06.010 --> 05:08.500
So we'll give them new functions.

05:09.730 --> 05:11.710
With blueprint native event.

05:12.340 --> 05:13.450
Both of them.

05:13.930 --> 05:15.970
That's the first change I'm going to make.

05:16.390 --> 05:20.440
Now, as soon as I make this change, we have to go into our enemy.

05:20.500 --> 05:26.830
I'm going to move it over to here and make sure that we're overriding the implementation version of

05:26.830 --> 05:27.880
each of these.

05:28.600 --> 05:32.650
That's our next step and we have to go into the cpp file.

05:33.720 --> 05:40.020
And find, highlight and unhighlight and change these to the implementation versions as well.

05:42.660 --> 05:46.230
Now that we've done this, we can't call these functions directly.

05:46.230 --> 05:48.540
We have to call execute on them.

05:48.540 --> 05:52.050
So that's the next thing we have to do in our player controller.

05:52.050 --> 05:59.010
So right here, instead of calling Unhighlight actor, we have to call the execute version.

05:59.010 --> 06:01.260
And we should call the static version.

06:01.440 --> 06:10.110
I highlight interface double colon execute on highlight actor passing in that actor last actor.

06:10.110 --> 06:11.220
Now here's the thing.

06:11.220 --> 06:16.830
Last actor needs to be an actor now, not an eye highlight interface.

06:16.830 --> 06:18.540
So we'll do that too.

06:18.810 --> 06:22.620
But let's change these to execute on highlight actor.

06:22.620 --> 06:24.570
This one has to be this actor.

06:24.570 --> 06:30.540
So let's get rid of those red squiggles by making last actor in this actor actor pointers.

06:30.780 --> 06:34.050
We'll do that right here in player controller dot h.

06:34.320 --> 06:36.480
Here's this actor and last actor.

06:36.480 --> 06:38.430
We're going to make them actor pointers.

06:38.430 --> 06:43.020
And we can now use t object pointer a actor for these.

06:49.190 --> 06:56.120
So now that they're actors back here in or a player controller, these two lines are just fine.

06:56.120 --> 07:04.730
And if we scroll down just a bit now after performing our trace, this actor doesn't need to be set

07:04.730 --> 07:06.680
as a result of a cast anymore.

07:06.680 --> 07:09.770
It can now be set to cursor, hit dot get actor.

07:09.770 --> 07:15.110
But we only want to set this if this actor implements the highlight interface.

07:15.110 --> 07:16.070
So we should check.

07:16.070 --> 07:17.480
We can say if.

07:18.670 --> 07:19.270
Cursor.

07:19.270 --> 07:20.500
Hit dot.

07:20.500 --> 07:21.700
Get actor.

07:22.480 --> 07:24.910
But this could be a null pointer.

07:25.330 --> 07:27.790
So we'll check is valid on it.

07:31.490 --> 07:35.000
So first of all, we're checking to see if that is a valid actor.

07:35.840 --> 07:41.660
We'll also check cursor hit get actor implements.

07:41.690 --> 07:45.770
We'll call implements you highlight interface.

07:46.970 --> 07:48.050
As well.

07:48.170 --> 07:55.610
So if the actor is valid and if it implements the highlight interface, this actor can be set to cursor

07:55.610 --> 07:57.230
hit dot, get actor.

07:57.530 --> 08:02.810
So we can replace that cast and we can move this into the check.

08:02.810 --> 08:10.940
But we also want to make sure in the else case if cursor hit dot get actor is not valid or it does not

08:10.940 --> 08:12.740
implement the interface.

08:12.740 --> 08:17.840
In that case, this actor can be explicitly set to null pointer.

08:18.380 --> 08:26.510
Now we should also check to see if last actor in this actor implement the interface before calling Unhighlight

08:26.510 --> 08:27.350
actor.

08:27.710 --> 08:35.360
So what we can do up here is we can do what we did here, checking if they're valid and if they implement

08:35.360 --> 08:36.440
the interface first.

08:36.440 --> 08:38.810
So we can copy this line with the if statement.

08:38.810 --> 08:40.070
Paste it here.

08:40.190 --> 08:41.480
But we're going to change it a little bit.

08:41.480 --> 08:43.190
We're going to say if is valid.

08:43.190 --> 08:44.540
Last actor.

08:46.590 --> 08:51.990
And last actor implements you highlight interface.

08:51.990 --> 08:56.520
If so, then we'll go ahead and execute Unhighlight actor on it.

08:57.030 --> 08:59.220
And we don't need to check if last actor.

08:59.670 --> 09:02.220
We can do the same thing for this actor.

09:02.220 --> 09:04.020
So we'll go ahead and paste this.

09:04.840 --> 09:12.010
And change is valid to checking this actor and changing implements to checking this actor.

09:12.010 --> 09:15.880
And then we'll call execute Unhighlight actor on this actor.

09:15.880 --> 09:19.300
And now we don't need that line there either.

09:19.930 --> 09:26.440
So that way if we have the player block cursor trace tag, if last actor is valid and it implements

09:26.440 --> 09:32.530
the highlight interface we execute on highlight actor with it, and we do the same thing for this actor.

09:33.610 --> 09:41.560
Now down here, if our cursor hit Get Actor is valid and it implements the highlight interface.

09:41.590 --> 09:43.540
Then we can set this actor.

09:44.320 --> 09:45.850
Equal to that actor.

09:45.880 --> 09:48.340
Otherwise, we set this actor to null.

09:49.230 --> 09:49.710
Next.

09:49.710 --> 09:56.010
We're also checking if last actor is not equal to this actor, and if that's the case, we want to unhighlight

09:56.010 --> 09:58.710
last actor and highlight this actor.

09:59.240 --> 10:03.020
So in this case we're going to make these checks again.

10:03.200 --> 10:07.400
I'm going to just copy these two if statements and paste them down here.

10:08.150 --> 10:14.240
But we're going to change them a little bit for last actor we do want to call Unhighlight actor.

10:14.450 --> 10:20.720
So this part here is what we want to do now instead.

10:20.720 --> 10:23.930
But for this actor we want to call highlight actor.

10:23.930 --> 10:30.020
So if this actor is valid and implements the interface we're going to call highlight Actor instead.

10:30.790 --> 10:34.270
So now these lines can replace these two lines.

10:34.450 --> 10:39.250
So what we're doing is going to result in the same outcome.

10:39.580 --> 10:45.130
Even though we might have more lines of code and it might not look so clean and concise anymore.

10:45.430 --> 10:46.750
But that's okay.

10:47.050 --> 10:54.310
We could even refactor these because checking if the actor is valid, seeing if it implements the highlight

10:54.310 --> 11:00.700
interface, and then executing that interface function on that actor, is all something we could do

11:00.700 --> 11:07.720
in a refactored function that takes in an actor something called highlight actor and unhighlight actor.

11:08.080 --> 11:14.620
We can go back to our player controller and just make two functions to do this void highlight actor,

11:14.620 --> 11:19.630
which takes in an a actor pointer called an actor.

11:20.890 --> 11:28.750
And we can make void Unhighlight actor which takes an a actor pointer called in actor as well.

11:29.080 --> 11:30.700
And these can do that work for us.

11:30.700 --> 11:32.770
And this will clean up our code a little bit.

11:32.770 --> 11:35.170
So let's generate these function definitions.

11:35.170 --> 11:38.530
Now writer gave me inline definitions.

11:38.530 --> 11:39.250
That's okay.

11:39.250 --> 11:45.190
I'm going to cut them and move them into here I'll put them right here just over cursor trace and remove

11:45.190 --> 11:46.390
the inline keywords.

11:46.390 --> 11:49.030
And they're going to do these lines here.

11:49.030 --> 11:53.830
So highlight actor is going to check if the in actor is valid.

11:53.830 --> 11:57.160
And the end actor implements the highlight interface.

11:57.160 --> 12:00.040
And then it calls I highlight interface execute.

12:00.040 --> 12:05.710
And we're going to execute highlight actor on it passing in the in actor there.

12:05.830 --> 12:10.690
And then Unhighlight actor is going to do the same thing almost.

12:11.600 --> 12:14.810
It's going to check if the in actor is valid.

12:15.410 --> 12:20.930
It's going to see if it implements the interface and then it will execute Unhighlight actor on it.

12:20.930 --> 12:25.550
So now we have these really easy to use functions that even could be static.

12:25.550 --> 12:28.100
Let's go ahead and make them static while we're at it.

12:28.250 --> 12:32.930
Static void highlight and Unhighlight.

12:32.930 --> 12:38.090
And now that we have these static functions, these lines of code can be cleaned up quite a bit.

12:38.090 --> 12:41.390
We can call Unhighlight actor on last actor here.

12:47.340 --> 12:48.870
I like that a lot better.

12:48.870 --> 12:52.260
And we can call Unhighlight actor on this actor here.

12:56.510 --> 13:03.530
That makes me feel a lot better because it looks great and we can do the same thing here, right here.

13:03.530 --> 13:09.590
If last actor is not this actor, it'll look a lot less confusing if we just call Unhighlight actor

13:09.590 --> 13:10.850
on Last Actor.

13:17.110 --> 13:21.280
And we call highlight actor on this actor.

13:26.840 --> 13:32.960
And now our code is more readable, looks better, and these functions take care of the interface function

13:32.960 --> 13:33.650
calls.

13:34.290 --> 13:34.740
Okay.

13:34.740 --> 13:37.590
So all of that work for the same result, right?

13:37.590 --> 13:44.370
But the thing is, it was worth it because now this actor and last actor are simply actors.

13:44.370 --> 13:53.100
And when we execute ability input tag pressed, we can now set our targeting status, which is now an

13:53.100 --> 13:53.850
enum.

13:54.410 --> 13:56.030
It's called targeting status.

13:56.060 --> 13:57.740
It's an E targeting status.

13:57.740 --> 14:03.440
And we want to know if we're highlighting an enemy or if we're highlighting anything else.

14:04.430 --> 14:09.500
We know that this actor implements the highlight interface, otherwise it would be null.

14:10.300 --> 14:12.190
We're checking that up here.

14:12.640 --> 14:17.860
If cursor hit Get actor implements highlight interface, we set this actor.

14:17.860 --> 14:21.460
Otherwise we set this actor explicitly to a null pointer.

14:21.460 --> 14:28.210
So we know that it's a highlight interface, but it's in the form of an actor, which is great because

14:28.210 --> 14:31.510
we can see if it implements the enemy interface.

14:31.510 --> 14:34.810
If it does, well, that's a different story, right?

14:34.810 --> 14:38.320
That means our targeting status should be set to.

14:38.930 --> 14:40.250
Targeting enemy.

14:40.250 --> 14:44.240
Otherwise we can set it to targeting map entrance.

14:44.240 --> 14:50.660
Or we could just have targeting Non-enemy because we may have something that's not a map entrance.

14:50.660 --> 14:52.940
Let's just set this to targeting Non-enemy.

14:53.810 --> 14:56.570
And that will cover everything that's not an enemy.

14:56.570 --> 15:01.730
And in that case, right here where we're setting targeting, we're going to do things a little differently

15:01.730 --> 15:02.330
here.

15:02.840 --> 15:03.950
We're going to say.

15:05.180 --> 15:07.820
Targeting status equals.

15:07.820 --> 15:12.050
And we'll check this actor, which is now an actor we can call implements on it.

15:12.050 --> 15:15.260
And we can see if it implements the you enemy interface.

15:16.200 --> 15:16.680
Now.

15:16.680 --> 15:24.450
If it does question mark, then targeting status can be set equal to targeting enemy.

15:24.990 --> 15:28.560
And if it's not, we can set it to targeting Non-enemy.

15:29.040 --> 15:30.120
See how that works.

15:30.120 --> 15:35.340
So now we have targeting status which is an enum rather than a boolean.

15:35.640 --> 15:38.970
And if we're targeting an enemy we can have the same exact behavior.

15:38.970 --> 15:42.510
But if we're targeting a non enemy we could do something else.

15:42.840 --> 15:45.330
So now we don't need this be targeting here.

15:45.330 --> 15:47.640
But we do need to find where we're using it.

15:47.640 --> 15:53.850
And right here on the scroll bar we can see the three places where the code is broken.

15:54.570 --> 15:58.350
Due to using be targeting because it doesn't exist anymore.

15:58.350 --> 16:00.030
So we can scroll down to those.

16:00.390 --> 16:03.600
The first thing here is an ability input tag released.

16:03.960 --> 16:09.630
We're saying if we're not targeting and we're not holding the shift key, well in that case we should

16:09.630 --> 16:10.590
auto run.

16:11.100 --> 16:15.990
But now we should auto run if we're not targeting an enemy.

16:15.990 --> 16:24.840
So instead of checking not be targeting, we can now check targeting status is not equal to targeting

16:24.840 --> 16:28.080
enemy if we're not targeting an enemy.

16:28.620 --> 16:31.770
Then we can auto run if we're not holding the shift key.

16:32.280 --> 16:37.410
And by the end of this auto run, we reset be targeting to false before.

16:37.410 --> 16:44.760
But now, rather than setting it to false, we can set targeting status to not targeting.

16:46.460 --> 16:49.340
Now let's scroll down to where we're using targeting here.

16:49.340 --> 16:52.130
This is an ability input tag held.

16:52.400 --> 16:56.300
We're seeing if we are targeting or the shift key is held down.

16:56.300 --> 17:00.770
We're calling the ability system component ability input tag held.

17:00.770 --> 17:03.110
So we can pass that input tag through.

17:03.110 --> 17:09.110
And this is really only if we're still targeting or we're still holding the shift key.

17:09.110 --> 17:11.270
That means we're targeting an enemy.

17:11.270 --> 17:16.040
So we're going to say if targeting status is equal to targeting enemy.

17:16.040 --> 17:24.500
And by the way, if you're uneasy about using these enum constants like this without fully qualifying

17:24.500 --> 17:29.270
them with the enum name, you could switch over to a scoped enum.

17:29.270 --> 17:36.020
You could make this enum class, and we could even specify this to be a uint eight based enum.

17:36.020 --> 17:40.610
And then we'll have to use targeting status double colon.

17:40.610 --> 17:48.560
Everywhere we're using these enum constant names, and in general that's a little bit better practice

17:48.560 --> 17:51.920
as this makes it clear where these constants are coming from.

17:51.920 --> 17:57.200
So while we're at it, we might as well go up to each of those places where we're using them.

17:57.200 --> 18:04.220
Again, looking at the scroll bar here where I see red and coming back and fixing these like this.

18:05.090 --> 18:13.220
Okay, so now we've made a few changes and we should expect to see the same exact behavior as before.

18:13.250 --> 18:19.250
The only difference now is that this actor and last actor are actors, which we can use to check to

18:19.250 --> 18:24.650
see if they implement any interface, including the enemy interface or the highlight interface.

18:24.650 --> 18:27.830
If they're not highlight interfaces, they're null.

18:27.830 --> 18:31.970
That's a requirement that we make up here in Cursor Trace.

18:32.180 --> 18:36.200
If they're not a highlight interface, they're set to null explicitly.

18:36.830 --> 18:41.900
So all we should do at this point is check to see if everything still works.

18:42.440 --> 18:45.260
We expect at least the same behavior as before.

18:45.290 --> 18:50.630
Otherwise we've made a regression, which is something we would have to then fix.

18:50.630 --> 18:57.260
But if all works the same as before, we now have the additional option to check.

18:57.910 --> 19:05.020
Okay, so player controller line 93 looks like I forgot to fully qualify not targeting right there.

19:05.020 --> 19:07.480
So with that we can compile.

19:08.610 --> 19:14.730
So as long as everything still works as before, this is great because instead of a boolean be targeting,

19:14.730 --> 19:21.480
we now have an enum targeting status, and we can check to see if that status is targeting an enemy

19:21.480 --> 19:23.370
or targeting a non enemy.

19:23.370 --> 19:25.320
And if we're targeting a non enemy.

19:25.350 --> 19:28.770
We can have different behavior whenever we click.

19:28.770 --> 19:32.100
We don't have to cast a spell targeting that thing.

19:32.370 --> 19:38.490
That thing being this actor we could do something else such as run over into a dungeon entrance.

19:38.490 --> 19:39.150
Right.

19:39.150 --> 19:41.790
So let's make sure everything still works.

19:41.790 --> 19:43.650
I'm going to go ahead.

19:44.890 --> 19:49.360
And go to my maps into the load menu and press play.

19:49.360 --> 19:52.090
I'm going to go ahead and delete this slot and make a new one.

19:53.690 --> 20:00.920
Call it Stephen new slot, select slot, press play and I have a fireball and I can highlight highlighting

20:00.920 --> 20:01.520
works.

20:01.520 --> 20:03.020
And if I left click.

20:03.470 --> 20:06.470
I'm targeting it if I left click elsewhere.

20:06.500 --> 20:08.840
Oh, I got a exception.

20:08.960 --> 20:12.980
Ability input tag pressed is checking this actor, which is actually null.

20:12.980 --> 20:18.680
Now, if we're checking if it implements the enemy interface, we actually have to make sure that it's

20:18.680 --> 20:22.400
valid as well, something that can easily be overlooked.

20:22.400 --> 20:27.680
So I'm going to hit stop and just make sure we place that check before accessing this actor.

20:27.680 --> 20:29.990
We are explicitly setting it to null, aren't we.

20:29.990 --> 20:36.170
So what I'm going to say is if is valid this actor that's important.

20:36.560 --> 20:38.000
So we'll do that first.

20:38.870 --> 20:42.140
And if so, then we'll do these two lines.

20:43.290 --> 20:44.190
Like this.

20:44.840 --> 20:47.030
Okay, so with that, let's try this again.

20:48.690 --> 20:55.740
This is why it's good to run in debug mode, because rather than an uninformative crash, we get pointed

20:55.740 --> 20:58.050
to exactly where the problem is.

20:58.050 --> 21:03.330
And this can make your development process much faster and much less painful.

21:04.510 --> 21:05.050
Okay.

21:05.050 --> 21:05.680
We're back.

21:05.680 --> 21:10.150
I'm going to go back to the loading menu and load in.

21:11.090 --> 21:16.430
And let's see, I can highlight I can Unhighlight, I can target, I can click elsewhere.

21:16.880 --> 21:17.390
Okay.

21:17.390 --> 21:20.810
So I should be only doing this if I'm pressing.

21:21.540 --> 21:23.400
The shift key, right?

21:28.900 --> 21:35.110
So we need to auto run if this actor is a null pointer.

21:35.410 --> 21:38.020
That's going to be an ability input tag released.

21:38.320 --> 21:40.930
So we're checking to see if we're not targeting an enemy.

21:40.930 --> 21:41.680
Right.

21:42.070 --> 21:44.230
And we're not holding the shift key down.

21:44.590 --> 21:51.100
Our targeting status should be set to not targeting if we're not highlighting over an enemy.

21:51.690 --> 21:55.950
Now, if this actor is null, then we still need to set.

21:56.130 --> 22:01.830
So we're checking if this actor is valid before setting the targeting status.

22:01.860 --> 22:06.300
Now, this doesn't account for the case when this actor is not valid.

22:06.300 --> 22:08.940
So we do need an else case here.

22:08.940 --> 22:12.600
And if this actor is not valid of course we're not targeting.

22:12.600 --> 22:18.900
So in this case targeting status should be set to targeting status not targeting.

22:19.500 --> 22:22.920
So with that we can compile and let's see how this works.

22:25.690 --> 22:26.200
Okay.

22:26.200 --> 22:30.970
So I'm going to go to the load menu and press play and select a slot and load it in.

22:30.970 --> 22:33.430
And the first thing I'm going to try is clicking.

22:33.430 --> 22:36.430
Now I don't have my nav mesh bounds volume over here.

22:36.430 --> 22:43.960
So clicking is not going to give me auto running behavior unless I go into where my nav mesh bounds

22:43.960 --> 22:44.680
volume is.

22:44.680 --> 22:50.170
And then I can click and get auto run behavior, which is exactly what I expect and want.

22:50.200 --> 22:52.390
Now if I hold shift and left click.

22:55.810 --> 22:59.800
Then I cast my spell and that's the behavior I want as well.

22:59.800 --> 23:05.800
And then the last, of course thing to check would be firing at a enemy target.

23:06.480 --> 23:11.430
So now when we're highlighting something, we know if we're highlighting an enemy and we know if we're

23:11.430 --> 23:16.980
not highlighting an enemy, and this is extremely useful for us if we want to be able to highlight non

23:16.980 --> 23:23.460
enemies, because in that case I would like to still highlight them.

23:24.000 --> 23:29.130
But in addition to that, I would like to do other things.

23:29.130 --> 23:35.730
For example, if I have a Non-enemy object that I'm highlighting and I click on it, I'd like to do

23:35.730 --> 23:36.690
something else.

23:37.340 --> 23:43.490
So in order to start developing that, we're going to need to create new actors that implement the highlight

23:43.490 --> 23:46.130
interface that do additional things.

23:46.130 --> 23:47.570
And we'll do that next.

23:47.600 --> 23:48.740
I'll see you soon.
