WEBVTT

00:07.240 --> 00:08.350
Welcome back.

00:08.350 --> 00:13.090
Now in this video we're going to look at one issue I noticed while testing.

00:13.090 --> 00:18.850
And this is just one of those things that pops up that you may have missed in development.

00:18.850 --> 00:22.600
I'm going to show you the issue and we can repro it this way.

00:22.600 --> 00:24.100
I have my.

00:25.310 --> 00:29.000
Fireblast assigned to slot two.

00:29.270 --> 00:33.860
I'm going to assign it to my right mouse button so I can see it here with my abilities.

00:33.860 --> 00:34.910
Menu open.

00:35.420 --> 00:42.800
Now, this is not an issue if we're disabling input while these menus are open, which is the default

00:42.800 --> 00:44.090
state that I'd like to have.

00:44.090 --> 00:48.590
But we have input possible for testing purposes.

00:48.590 --> 00:53.270
And this issue only pops up with the menu open.

00:53.270 --> 00:54.860
And I'm going to show you what happens.

00:54.860 --> 01:02.090
I'm going to activate this ability Fireblast which has a long cooldown like five seconds or so.

01:02.090 --> 01:08.300
And during that cooldown before the cooldown is over, I'm going to reassign Fireblast to a different

01:08.300 --> 01:13.400
slot, such as the left mouse button, and that's going to make my right mouse button vacant.

01:13.400 --> 01:19.490
It's going to be empty, and it's going to still be updating the cooldown timer.

01:19.490 --> 01:23.690
That's because, well, we're never actually telling it not to.

01:23.690 --> 01:25.460
So I'm going to show you the issue.

01:25.460 --> 01:29.930
I'm going to cast the spell and equip to the left mouse button.

01:33.030 --> 01:33.660
I was too late.

01:33.660 --> 01:34.770
I'm gonna try again.

01:36.980 --> 01:37.610
There we go.

01:37.610 --> 01:44.870
So we have the cooldown and as soon as it's done now we're setting this to a blank texture.

01:44.870 --> 01:50.810
And that's because we're setting the render opacity for the texture back to one, but it no longer has

01:50.810 --> 01:52.190
a valid texture.

01:52.490 --> 02:00.260
So really what we should be doing is first of all, not setting this back if we've reassigned the ability

02:00.260 --> 02:01.430
somewhere else.

02:01.430 --> 02:08.240
And we should also stop showing that countdown value, we can even stop the countdown altogether if

02:08.240 --> 02:12.410
we've reassigned this ability to somewhere else.

02:12.560 --> 02:15.860
So how do we know we've reassigned the ability?

02:15.860 --> 02:17.660
Well, let's open our spell globe.

02:17.660 --> 02:21.200
Not the spell globe button, just the regular spell globe.

02:21.200 --> 02:23.510
This is the one that responds to cooldowns.

02:26.310 --> 02:31.620
Now, if we're in the cool down here, we know that we have a cooldown timer handle we can clear and

02:31.620 --> 02:33.360
invalidate in any time.

02:33.780 --> 02:40.020
So how do we know when we've reassigned this ability somewhere else and this globe should be empty?

02:40.290 --> 02:46.830
Well, we receive ability info, and when we receive ability info that matches with our input tag,

02:46.830 --> 02:49.860
we're checking to see if it's equal to abilities none.

02:49.860 --> 02:52.710
If it's ability is none, we clear the globe.

02:52.710 --> 02:54.690
We can do lots of things here.

02:54.690 --> 03:00.660
We can also clear and invalidate the timer so that we never reach the end of that timer.

03:00.840 --> 03:02.550
Our timer is called.

03:04.650 --> 03:08.820
Cool down timer handle so and receive ability info here.

03:08.820 --> 03:11.250
We can take cool down timer handle.

03:14.420 --> 03:16.820
And we can clear and invalidate the timer.

03:17.090 --> 03:20.660
So clear and invalidate timer by handle.

03:20.900 --> 03:25.580
And now we'll never reach the end of that cooldown timer.

03:27.290 --> 03:29.660
Let's go ahead and see how this works.

03:29.660 --> 03:33.350
So I'm going to assign the ability to the right mouse button.

03:33.350 --> 03:37.370
And I'm going to cast the spell and then assign it to somewhere else.

03:37.370 --> 03:38.120
Here we go.

03:40.870 --> 03:43.570
Okay, so we've stopped the timer.

03:43.570 --> 03:49.630
We also need to stop showing that countdown text, so let's take care of that as well.

03:50.990 --> 03:58.070
So what we can do is we can get our countdown text and I can't remember what it's called.

03:58.720 --> 04:00.730
Text cooldown is what it's called.

04:01.940 --> 04:03.890
So we can get text cooldown.

04:07.560 --> 04:12.870
And I think the way that we're clearing this is by setting its render opacity.

04:12.870 --> 04:15.360
But I want to make sure I'm doing this consistently.

04:15.390 --> 04:16.290
If we go to update.

04:16.290 --> 04:17.610
Cooldown timer.

04:17.610 --> 04:19.140
Text cooldown.

04:19.720 --> 04:21.760
We set default state.

04:22.030 --> 04:25.450
And yes, we're setting render opacity to zero.

04:25.450 --> 04:30.640
So back in receive ability info I'm going to call set Render Opacity.

04:32.350 --> 04:34.030
And set it to zero here.

04:34.060 --> 04:34.690
Okay.

04:34.690 --> 04:36.520
Let's try to repro the issue again.

04:37.620 --> 04:40.080
Equipping to right mouse button.

04:40.580 --> 04:45.950
Casting and re-equipping and it looks fine and that cooldown has stopped.

04:45.950 --> 04:50.330
And if I assign something else here, then we now have something else here.

04:50.330 --> 04:52.220
So that fixes that issue.

04:52.220 --> 04:57.920
Now these are these little problems that can pop up, and they're kind of hard to catch while you're

04:57.920 --> 04:58.790
developing.

04:58.790 --> 05:01.670
And they just sort of pop up in testing.

05:01.670 --> 05:07.160
And that's partially why testing is so important because issues like this pop up.

05:07.520 --> 05:12.890
So it's possible during testing you may find other small issues here and there.

05:12.890 --> 05:20.600
And it's really just a skill that you have to develop finding these edge cases and figuring out solutions

05:20.600 --> 05:21.320
for them.

05:22.130 --> 05:22.640
All right.

05:22.640 --> 05:24.170
That's going to conclude this video.

05:24.170 --> 05:25.820
And I'll see you in the next one.
