Would you like to inspect the original subtitles? These are the user uploaded subtitles that are being translated:
1
00:00:03,850 --> 00:00:08,560
Now we want to ensure that when the time reaches zero, it actually reloads the game.
2
00:00:08,950 --> 00:00:11,230
So in words, it takes you up to the next level.
3
00:00:11,740 --> 00:00:15,080
So to do this, first of all, we need to ensure that we're saving our scene.
4
00:00:15,800 --> 00:00:21,670
Then we need to go to file and build settings and show that your main scene is actually in your build
5
00:00:21,670 --> 00:00:24,790
settings and it sits at level zero at the moment.
6
00:00:25,300 --> 00:00:29,110
OK, so we're just simply going to call that and reload it.
7
00:00:29,860 --> 00:00:37,360
So in our script, in order to actually load scenes, we tell it that we're using the scene management
8
00:00:37,360 --> 00:00:39,310
so that we get access to those terms.
9
00:00:39,950 --> 00:00:52,510
So using unity engine scene management, OK, that's going to allow us then to load levels as now when
10
00:00:52,510 --> 00:00:57,930
we come down to a time count down, then we're at level.
11
00:00:57,940 --> 00:01:03,910
Current time is less than or equal to zero, just going to come into this time time scale zero.
12
00:01:03,910 --> 00:01:08,740
So instead of pausing, what I'm going to do is just basically reload the game, reload the level.
13
00:01:09,310 --> 00:01:14,170
So I'm simply going to say scene manager.
14
00:01:18,210 --> 00:01:23,280
The load scene and then inside the brackets, it just needs a scene.
15
00:01:23,310 --> 00:01:24,780
No, which was zero.
16
00:01:27,180 --> 00:01:27,600
That's it.
17
00:01:28,200 --> 00:01:28,570
All right.
18
00:01:28,590 --> 00:01:29,310
Nice and easy.
19
00:01:29,850 --> 00:01:31,080
So if you just save that.
20
00:01:32,100 --> 00:01:36,900
So for testing purposes, I'll probably make the scene about five seconds.
21
00:01:37,410 --> 00:01:44,760
So if on the ground, if I now change my level time limit to something like five, it should start off
22
00:01:44,760 --> 00:01:47,460
on five and then basically reload when it gets to zero.
23
00:01:49,710 --> 00:01:52,230
Here we go, three to one.
24
00:01:53,150 --> 00:01:53,600
You're out.
25
00:01:53,620 --> 00:01:54,120
There we go.
26
00:01:54,420 --> 00:01:54,990
Reload.
27
00:01:57,690 --> 00:01:58,710
And it will just keep going.
28
00:01:59,040 --> 00:02:05,430
OK, so basically we only have to survive five seconds, which is extremely easy.
29
00:02:06,240 --> 00:02:10,110
But you will notice to all of my enemies are actually on scene all at the same time.
30
00:02:10,920 --> 00:02:15,030
Which is going to make it a little bit more complex, a little bit more difficult.
31
00:02:15,330 --> 00:02:20,340
So what we're going to do in the next video is ensure that the enemies switch on at different times.
2935
Can't find what you're looking for?
Get subtitles in any language from opensubtitles.com, and translate them here.