WEBVTT

00:07.480 --> 00:08.740
Welcome back.

00:09.160 --> 00:11.920
Now we've made some changes, quite a few.

00:11.920 --> 00:15.160
And so far we just have the same behavior.

00:15.160 --> 00:20.290
We're just highlighting our enemies when we hover over them and making them highlight red.

00:20.770 --> 00:26.650
But the key difference here is that now we can implement this interface in any actor we want.

00:27.200 --> 00:31.940
Let's just say we'd like to implement it here on our checkpoints.

00:32.420 --> 00:36.620
If we hover over a checkpoint, we'd like to highlight that checkpoint.

00:37.040 --> 00:43.610
Well, if we go back into our highlight interface right here, we can make our interface a blueprint

00:43.610 --> 00:49.070
type if we like, by adding blueprint type right here in the U interface.

00:49.160 --> 00:56.120
Now, if we do this now, all of a sudden we can implement functionality for highlight actor and un

00:56.120 --> 00:58.490
highlight actor in our blueprints.

00:58.520 --> 01:04.700
This makes it easier to extend this functionality to different classes in the editor, because we then

01:04.700 --> 01:09.050
don't have to go and create C plus plus classes for those actors.

01:09.080 --> 01:14.750
Our checkpoint, for example, could implement the interface in blueprint and not in its C plus plus

01:14.750 --> 01:15.350
class.

01:15.350 --> 01:21.560
And then we can just decide what happens when that checkpoint is highlighted and unhighlighted.

01:21.590 --> 01:23.180
Let's give this a try.

01:24.750 --> 01:31.800
So back in the editor, if I take my BP checkpoint and I open that blueprint, I can go to class settings

01:31.800 --> 01:37.290
to implement IT interfaces and I can implement highlight interface if I do that.

01:37.290 --> 01:43.320
Now, if I right click and type highlight actor, we have event highlight actor.

01:43.320 --> 01:47.820
And we also can implement UN Highlight Actor.

01:51.070 --> 01:53.290
And we can decide what happens here.

01:53.930 --> 02:05.240
Now if I go to my mesh and on the mesh, if I search for custom depth and I check render custom depth

02:05.240 --> 02:13.220
pass, I can give this a value, say 252 and that's going to give this a highlight.

02:13.940 --> 02:17.900
If I look at it here in the world, it has this highlight, right?

02:17.900 --> 02:19.400
And it's the tan color.

02:20.010 --> 02:27.030
Now in the event graph for event highlight actor, I can set this to true or false I can set.

02:28.230 --> 02:30.780
Render custom depth.

02:31.480 --> 02:32.230
Right here.

02:32.230 --> 02:35.500
Set render custom depth for the checkpoint mesh.

02:35.500 --> 02:37.240
I can set it to true.

02:38.100 --> 02:42.960
For highlight actor and I can set it to false for Unhighlight actor.

02:42.960 --> 02:44.310
So I'm going to duplicate it.

02:44.310 --> 02:47.280
Set it to false here for Unhighlight actor.

02:49.910 --> 02:56.210
And because we're implementing the interface, this will be called now checkpoint mesh is going to need

02:56.210 --> 02:57.800
to be blueprint read only.

02:57.800 --> 03:00.350
So we'll go ahead and fix that up.

03:00.350 --> 03:02.000
Let's go ahead and close down.

03:02.000 --> 03:04.040
We'll go to our checkpoint class.

03:09.850 --> 03:11.680
And make our checkpoint mesh.

03:12.780 --> 03:17.490
Blueprint read only for that I'm going to move it into the protected section.

03:22.220 --> 03:23.840
Given blueprint read only.

03:26.090 --> 03:27.440
And recompile.

03:31.100 --> 03:34.790
Now back in our BP checkpoint, we compile just fine.

03:34.790 --> 03:37.580
Now we just need to see if we can highlight it.

03:38.260 --> 03:39.700
Let's press play.

03:40.810 --> 03:42.670
Now it starts off highlighted.

03:42.670 --> 03:45.460
So we're going to want to start it off unhighlighted.

03:45.460 --> 03:48.670
But as you can see we can highlight it.

03:48.670 --> 03:49.960
And if I click on it.

03:50.550 --> 03:52.950
We don't launch a fireball.

03:52.950 --> 03:55.290
And we wouldn't even if we had a fireball equipped.

03:55.290 --> 03:57.060
Let's test that theory, though.

03:57.060 --> 04:01.320
Let's go ahead and select a slot, press play and click on it.

04:01.710 --> 04:05.970
And as you can see, we don't launch fireballs unless we hold the shift key down.

04:07.000 --> 04:12.280
Now this business of starting off highlighted already can be fixed.

04:12.280 --> 04:19.600
If we take that checkpoint mesh and search for custom depth and uncheck Render Custom Depth Pass, we

04:19.600 --> 04:22.000
can set that to false by default.

04:22.690 --> 04:27.520
And now if we go in and play, it's not highlighted until we hover over it.

04:27.520 --> 04:30.340
So now we can highlight enemies and they're red.

04:30.340 --> 04:34.450
We can highlight other things and we can choose the color for those separately.

04:34.810 --> 04:41.050
Now this is pretty cool because now we can see if we highlight on a checkpoint that.

04:41.740 --> 04:43.540
It's something special, right?

04:43.540 --> 04:49.120
Something highlighting in the game informs you that there's something about that thing that you can

04:49.120 --> 04:49.900
interact with it.

04:49.900 --> 04:51.640
You can do something with it.

04:51.640 --> 04:52.180
Right?

04:52.180 --> 04:54.520
So that makes things special.

04:54.520 --> 05:00.280
Now for checkpoints in particular, and also dungeon entrances and other things.

05:00.280 --> 05:09.070
I would like the particular quality of being able to click on it and move to a specific location on

05:09.070 --> 05:18.310
that actor, like a spot on the checkpoint where we go to maybe it's over here, over here, or right

05:18.310 --> 05:18.850
there.

05:18.850 --> 05:24.010
No matter where I click on the checkpoint, I want to walk over to a specific place.

05:24.010 --> 05:26.800
Now this is going to be useful for dungeon entrances.

05:26.800 --> 05:34.510
Let's say we have a staircase going down, and if I click on it, I'd like to auto run down into the

05:34.510 --> 05:35.200
stairs.

05:35.200 --> 05:35.470
Right.

05:35.470 --> 05:36.550
So something like that.

05:36.550 --> 05:43.780
So our highlight interface can have a function that returns us a location that we can auto run to,

05:43.780 --> 05:50.290
and perhaps even a boolean that tells us whether or not we should even bother doing this auto running

05:50.290 --> 05:51.070
business.

05:51.490 --> 05:53.770
So that's something that I'd like to implement.

05:53.770 --> 06:01.660
And this could be something we put on our checkpoint class, for example, some kind of location or

06:01.660 --> 06:07.120
scene component that once we click, we can get that location and run to it.

06:07.120 --> 06:11.350
So that's the next thing I'd like to implement and we'll do that next.

06:11.980 --> 06:14.830
Great job and I'll see you in the next video.
