WEBVTT

00:07.070 --> 00:08.150
Welcome back.

00:08.180 --> 00:13.550
Now our electric beam looks pretty good, but you might have been bothered a little bit by the fact

00:13.550 --> 00:15.290
that it just goes through walls.

00:15.290 --> 00:22.790
And if you click up here on the wall and you launch that beam, it doesn't go up to where you're clicking.

00:22.790 --> 00:27.230
It goes to the location of our hit result.

00:27.230 --> 00:32.330
And of course, these walls are not responding to the visibility channel.

00:32.360 --> 00:34.720
That's why we're not getting that hit.

00:34.730 --> 00:41.360
So what we can do is our target data under mouse, which is what is used by our gameplay abilities,

00:41.390 --> 00:44.660
doesn't really need to be ignored by the surroundings.

00:44.660 --> 00:47.210
It can actually be blocked by everything.

00:47.300 --> 00:53.060
And the easiest way to make that happen is to make it have its own trace channel.

00:53.060 --> 00:54.560
And we can make a trace channel.

00:54.560 --> 00:55.910
We've done so before.

00:55.910 --> 01:02.180
In this course we can go to Project Settings and search for object and under Object channels.

01:02.180 --> 01:08.660
Here's our custom projectile channel set to ignore everything by default, we can click New Object Channel

01:08.660 --> 01:09.910
and create a new one.

01:09.920 --> 01:14.270
Now I'd like this to be used by our target data under Mouse Ability task.

01:14.270 --> 01:16.130
So I'm just going to call it target.

01:16.130 --> 01:18.560
And I'm going to leave it to block everything.

01:18.560 --> 01:20.240
So I'm going to click accept.

01:20.240 --> 01:23.360
And now we have a target trace channel.

01:23.540 --> 01:29.480
And what we can do is we can set our target data under mouse to use that channel.

01:29.480 --> 01:34.240
And before we do that I'm going to define a macro symbol for it.

01:34.250 --> 01:40.580
I'm going to say pound define EQ underscore target.

01:40.580 --> 01:48.380
And this will be collision channel EQ game trace channel two.

01:48.380 --> 01:52.820
As we've already created one custom channel that's channel one.

01:52.850 --> 01:55.010
The next becomes channel two.

01:55.010 --> 02:01.940
And then we can go into our ability task under private ability system ability tasks target data under

02:01.940 --> 02:02.720
mouse.

02:02.720 --> 02:08.450
And we can find in send mouse cursor data where we're calling get hit result under cursor.

02:08.480 --> 02:13.100
Here we can change this to trace against EQ target.

02:13.130 --> 02:13.520
Now.

02:13.520 --> 02:17.540
Now that means we have to include the ora h header file.

02:17.540 --> 02:18.950
So I'll go ahead and do that.

02:18.950 --> 02:21.980
And with that we can go ahead and launch the editor.

02:23.010 --> 02:26.010
So back in the editor, I can press play now.

02:26.010 --> 02:32.640
And if I right click and hold now, I see my electric beam is hitting everything because everything

02:32.640 --> 02:35.880
blocks against that target channel that we're using.

02:35.970 --> 02:42.230
In fact, I can launch a fireball as well, and it'll go towards those locations that I'm clicking on.

02:42.240 --> 02:43.980
So that's pretty nice.

02:44.990 --> 02:52.250
Now this fixes a lot of issues, but since everything blocks it, this can create complications.

02:52.250 --> 02:58.910
For example, if I come up to the edge and I right click and hold, well, you expect me to zap down

02:58.910 --> 03:05.870
there on the floor, but I'm zapping up towards the camera because there's a blocking volume here.

03:05.870 --> 03:10.760
And if everything blocks target by default, that includes this blocking volume.

03:10.760 --> 03:18.710
So we have to uncheck or at least check ignore for the target trace channel on our blocking volume.

03:18.710 --> 03:20.720
And that should fix that issue.

03:24.130 --> 03:27.220
But if I right click right in the middle.

03:27.250 --> 03:31.720
Well, remember Ora has a box component right there.

03:31.720 --> 03:36.640
So we also need to make sure the box component ignores the target channel as well.

03:36.640 --> 03:40.120
So we'll open Ora and get that box selected.

03:40.120 --> 03:43.840
And we'll make sure the box ignores the target channel.

03:46.100 --> 03:50.720
Okay, saving all and just performing a quick test.

03:50.750 --> 03:52.700
Now we see that it's working.

03:54.410 --> 03:56.630
Okay, so that looks good.

03:56.630 --> 03:58.820
But there's also an issue.

03:58.820 --> 04:00.080
And you know what?

04:00.080 --> 04:01.640
These goblins are in the way.

04:01.850 --> 04:05.270
So I'm just going to really quickly delete them.

04:05.270 --> 04:09.620
As I'm testing we can very easily bring them back in.

04:13.920 --> 04:14.250
Okay.

04:14.250 --> 04:18.520
With no goblins to distract me, I'm going to go into the tunnel.

04:18.540 --> 04:22.290
And as that fade actor on top fades out.

04:22.380 --> 04:25.440
Watch what happens first of all, before it fades out.

04:25.470 --> 04:31.470
Notice that we can zap up onto the ceiling here, or at least up onto the wall, but when it fades out,

04:31.470 --> 04:34.260
we expect it not to block anything, right?

04:34.260 --> 04:39.780
But if we right click notice that we're zapping up to that ceiling again.

04:40.690 --> 04:44.650
So what we need is when the fade actor fades out.

04:44.680 --> 04:47.460
We need it to ignore the target channel.

04:47.470 --> 04:53.470
And really, the fade actor doesn't even need to block the visibility channel at all anymore.

04:53.620 --> 05:01.480
So if I browse to the Fade Actor folder and open up Fade Actor the parent class to all fade actors,

05:01.510 --> 05:03.400
we can go to the event graph.

05:04.190 --> 05:12.080
And notice that when a timeline finishes, we have this fade finished passing in that fade amount,

05:12.170 --> 05:13.790
and we're checking the fade amount.

05:13.790 --> 05:19.880
We're checking to see if that fade amount is greater than or equal to zero, and then saying if block

05:19.880 --> 05:23.180
visibility is true, block the visibility channel.

05:23.330 --> 05:27.230
And then we check to see if that fade amount is less than or equal to zero.

05:27.230 --> 05:31.780
And if block visibility is true, then ignore the visibility channel.

05:31.790 --> 05:38.500
So what I'd like to do instead now is first of all no longer use that block visibility Boolean.

05:38.510 --> 05:46.370
Instead, I'm just going to set our mesh to ignore and block the target channel instead.

05:46.700 --> 05:53.090
So where here, when the fade amount is less than or equal to zero, we're fading out, which means

05:53.090 --> 05:58.010
we should ignore not the visibility channel anymore, but the target channel.

05:58.010 --> 06:04.100
And then here, when the fade amount is greater than or equal to one, we know that we've just faded

06:04.100 --> 06:11.210
back in and we want to set not the visibility channel but the target channel to block.

06:11.480 --> 06:16.930
Now we can't forget why we had this block visibility boolean in the first place.

06:16.940 --> 06:25.640
This is for things that should block the visibility and unblock visibility or ignore it when faded out.

06:25.640 --> 06:30.830
And that's going to be things that fade out, but also that we want to walk up onto like this right

06:30.830 --> 06:31.490
here.

06:32.400 --> 06:36.780
So we're also going to check block visibility.

06:36.960 --> 06:44.640
And in the case of where we're setting the response to target to block, we're also going to set the

06:44.640 --> 06:46.920
response to visibility to block.

06:47.340 --> 06:55.770
And when we're setting the response to target to ignore, we're going to set the response to visibility

06:55.770 --> 06:57.000
to ignore as well.

06:58.200 --> 07:00.360
So we'll have both.

07:02.670 --> 07:04.440
So ignore down here.

07:04.440 --> 07:05.520
Block up there.

07:06.680 --> 07:08.990
Okay, we can test this out.

07:16.460 --> 07:22.160
And really, it's this piece right here that that pertains to.

07:22.190 --> 07:26.950
Now, one last issue, and you may have noticed this.

07:26.960 --> 07:32.940
If we barely, barely just touch on the edge, you'll see that it fades back in.

07:32.960 --> 07:37.700
So why is it fading out and fading back in so much?

07:37.940 --> 07:43.430
Now, this might have been something that stumped you, but that's because it's not a very obvious reason.

07:43.640 --> 07:51.020
If we browse to this asset and we open it up and we take a look at the mesh being used here, this is

07:51.020 --> 07:53.990
a composite mesh made of several meshes.

07:53.990 --> 08:01.310
And if we browse to it and open up this static mesh, we'll see that because it's made of several meshes,

08:01.340 --> 08:04.420
there's a very important thing we have to know about this.

08:04.430 --> 08:11.570
And that's if we check out our collision let's go to show and simple collision.

08:11.870 --> 08:13.630
Notice there's no green.

08:13.640 --> 08:15.410
We don't have a collision hull.

08:15.560 --> 08:17.120
So how is it colliding.

08:17.120 --> 08:24.860
Well if we type complex we'll see collision complexity use complex collision as simple.

08:25.160 --> 08:30.140
Now if we're using complex as simple and this is made up of several meshes.

08:30.140 --> 08:34.580
Well that's going to trigger multiple overlap and end overlaps.

08:34.580 --> 08:42.800
But if we take this and set it to project default and with collision you could just go to add box simplified

08:42.800 --> 08:43.340
collision.

08:43.340 --> 08:46.100
So we have one single collision hull.

08:46.130 --> 08:48.110
Now this should behave itself.

08:48.110 --> 08:50.030
And if we test out.

08:50.670 --> 08:51.720
The game.

08:52.970 --> 08:55.520
Now we see that it fades in only once.

08:56.600 --> 08:59.330
No more strange behavior.

09:00.570 --> 09:04.620
And of course, target data behaves as it should.

09:04.620 --> 09:09.450
And if we come back out, target data behaves as it should.

09:10.850 --> 09:11.690
Perfect.

09:13.060 --> 09:18.100
Okay, so that was a pretty important detail that I thought we should address.

09:18.100 --> 09:24.300
And yes, if we zap something behind a pillar, it'll go through the pillar.

09:24.310 --> 09:26.170
We'll take care of that with our beam.

09:26.170 --> 09:26.650
Don't worry.

09:26.650 --> 09:34.480
It's going to be robust, but at least now we can zap things and know that our zap will go where it's

09:34.480 --> 09:35.200
intended.

09:35.230 --> 09:36.190
Great job.

09:36.310 --> 09:37.390
I'll see you soon.
