Welcome back.
Now we've made some changes, quite a few.
And so far we just have the same behavior.
We're just highlighting our enemies when we hover over them and making them highlight red.
But the key difference here is that now we can implement this interface in any actor we want.
Let's just say we'd like to implement it here on our checkpoints.
If we hover over a checkpoint, we'd like to highlight that checkpoint.
Well, if we go back into our highlight interface right here, we can make our interface a blueprint
type if we like, by adding blueprint type right here in the U interface.
Now, if we do this now, all of a sudden we can implement functionality for highlight actor and un
highlight actor in our blueprints.
This makes it easier to extend this functionality to different classes in the editor, because we then
don't have to go and create C plus plus classes for those actors.
Our checkpoint, for example, could implement the interface in blueprint and not in its C plus plus
class.
And then we can just decide what happens when that checkpoint is highlighted and unhighlighted.
Let's give this a try.
So back in the editor, if I take my BP checkpoint and I open that blueprint, I can go to class settings
to implement IT interfaces and I can implement highlight interface if I do that.
Now, if I right click and type highlight actor, we have event highlight actor.
And we also can implement UN Highlight Actor.
And we can decide what happens here.
Now if I go to my mesh and on the mesh, if I search for custom depth and I check render custom depth
pass, I can give this a value, say 252 and that's going to give this a highlight.
If I look at it here in the world, it has this highlight, right?
And it's the tan color.
Now in the event graph for event highlight actor, I can set this to true or false I can set.
Render custom depth.
Right here.
Set render custom depth for the checkpoint mesh.
I can set it to true.
For highlight actor and I can set it to false for Unhighlight actor.
So I'm going to duplicate it.
Set it to false here for Unhighlight actor.
And because we're implementing the interface, this will be called now checkpoint mesh is going to need
to be blueprint read only.
So we'll go ahead and fix that up.
Let's go ahead and close down.
We'll go to our checkpoint class.
And make our checkpoint mesh.
Blueprint read only for that I'm going to move it into the protected section.
Given blueprint read only.
And recompile.
Now back in our BP checkpoint, we compile just fine.
Now we just need to see if we can highlight it.
Let's press play.
Now it starts off highlighted.
So we're going to want to start it off unhighlighted.
But as you can see we can highlight it.
And if I click on it.
We don't launch a fireball.
And we wouldn't even if we had a fireball equipped.
Let's test that theory, though.
Let's go ahead and select a slot, press play and click on it.
And as you can see, we don't launch fireballs unless we hold the shift key down.
Now this business of starting off highlighted already can be fixed.
If we take that checkpoint mesh and search for custom depth and uncheck Render Custom Depth Pass, we
can set that to false by default.
And now if we go in and play, it's not highlighted until we hover over it.
So now we can highlight enemies and they're red.
We can highlight other things and we can choose the color for those separately.
Now this is pretty cool because now we can see if we highlight on a checkpoint that.
It's something special, right?
Something highlighting in the game informs you that there's something about that thing that you can
interact with it.
You can do something with it.
Right?
So that makes things special.
Now for checkpoints in particular, and also dungeon entrances and other things.
I would like the particular quality of being able to click on it and move to a specific location on
that actor, like a spot on the checkpoint where we go to maybe it's over here, over here, or right
there.
No matter where I click on the checkpoint, I want to walk over to a specific place.
Now this is going to be useful for dungeon entrances.
Let's say we have a staircase going down, and if I click on it, I'd like to auto run down into the
stairs.
Right.
So something like that.
So our highlight interface can have a function that returns us a location that we can auto run to,
and perhaps even a boolean that tells us whether or not we should even bother doing this auto running
business.
So that's something that I'd like to implement.
And this could be something we put on our checkpoint class, for example, some kind of location or
scene component that once we click, we can get that location and run to it.
So that's the next thing I'd like to implement and we'll do that next.
Great job and I'll see you in the next video.