Would you like to inspect the original subtitles? These are the user uploaded subtitles that are being translated:
1
00:00:06,656 --> 00:00:12,800
So if you want the camera actually folder
2
00:00:13,568 --> 00:00:19,200
Thing we installed that package the very beginning of this section called cinemachine
3
00:00:19,968 --> 00:00:20,992
There it is
4
00:00:21,504 --> 00:00:24,832
Actually going to create a 2D camera
5
00:00:25,088 --> 00:00:28,160
It's going to do a ton of work for us
6
00:00:28,416 --> 00:00:30,208
That we really nice to yourselves
7
00:00:30,976 --> 00:00:37,120
Post office created was called a virtual camera which basically just controls the main camera and you can see
8
00:00:37,376 --> 00:00:43,520
Cinemachine icon here which means that it's got a cinemachine brain it's really creepy
9
00:00:43,776 --> 00:00:49,920
It's got a controller on it that throws the camera so we need these two game objects the main can
10
00:00:50,176 --> 00:00:52,992
And also the virtual camera as well
11
00:00:53,504 --> 00:00:59,648
I don't like the way this is named it's really confusing it's camera main
12
00:00:59,904 --> 00:01:00,781
I think that's what it means
13
00:01:00,783 --> 00:01:03,131
Subtitled by
-♪ online-courses.club ♪-
We compress knowledge for you!
https://t.me/joinchat/ailxpXoW3JVjYzQ1
14
00:01:03,132 --> 00:01:04,256
Is just a messy way of saying blog
15
00:01:04,512 --> 00:01:06,560
Is the virtual camera
16
00:01:07,584 --> 00:01:13,728
Virtual camera all it does it has the script on it and it controls the main camera
17
00:01:13,984 --> 00:01:14,752
Holidays
18
00:01:15,008 --> 00:01:21,152
Is a lot of stuff here guys there's a lot of stuff that we're not going to get into you in
19
00:01:21,408 --> 00:01:27,552
Weirdly enough I feel weird giving this advice but I found that this is absolutely true when you met
20
00:01:27,808 --> 00:01:28,320
A game
21
00:01:28,832 --> 00:01:30,880
If you try and understand everything
22
00:01:31,136 --> 00:01:37,280
If you obsessively looking into every little variable trying to understand things you're going to become overwhelmed
23
00:01:37,792 --> 00:01:43,936
How to make games for a 10 years I will look at this cinemachine virtual camera script and look at the cinema
24
00:01:44,192 --> 00:01:49,312
Brain there's like maybe three or four variables that I worry about the rest is
25
00:01:49,568 --> 00:01:50,592
Honestly
26
00:01:50,848 --> 00:01:54,432
It's pretty messy and it looks like something and only understand
27
00:01:54,944 --> 00:01:57,248
Are we going to worry about right now
28
00:01:57,504 --> 00:01:59,296
Is the follow
29
00:01:59,552 --> 00:02:00,576
Variable
30
00:02:00,832 --> 00:02:04,160
What do we want the cinemachine virtual camera to follow
31
00:02:04,672 --> 00:02:06,464
We want to follow the player
32
00:02:06,720 --> 00:02:10,304
You can see her as 9 princess is transform
33
00:02:10,816 --> 00:02:14,400
What that means is right now nothing is actually set
34
00:02:15,168 --> 00:02:19,008
Specifically it's looking for a transform value
35
00:02:19,264 --> 00:02:25,152
What is the transformed value that we what was the players transform value
36
00:02:25,664 --> 00:02:26,944
Wants to follow
37
00:02:27,968 --> 00:02:28,992
A position
38
00:02:29,504 --> 00:02:30,784
Of the player
39
00:02:31,040 --> 00:02:32,576
The access that
40
00:02:32,832 --> 00:02:34,624
Well it's actually really simple
41
00:02:34,880 --> 00:02:37,696
Are we going to do is simply drag the player
42
00:02:38,464 --> 00:02:39,488
Sheffield
43
00:02:39,744 --> 00:02:41,792
Is going to find the trains for value
44
00:02:42,048 --> 00:02:44,096
Associated with what we were just dragging
45
00:02:44,352 --> 00:02:45,376
Simple
46
00:02:45,888 --> 00:02:48,448
Save it and press play
47
00:02:51,520 --> 00:02:53,312
No man is an amazing guys
48
00:02:53,824 --> 00:02:55,616
I know what you're thinking
49
00:02:55,872 --> 00:03:02,016
Is a lot easier than I thought and that's because making games doesn't require you to code everything
50
00:03:02,272 --> 00:03:08,416
I like to be involved in a lot of the code that's 10 of the way my brain works I like to have a good understanding of the code
51
00:03:08,928 --> 00:03:15,072
What is the camera movement and also the physics object that we copied and pasted from universe website
52
00:03:16,096 --> 00:03:19,680
You know I like those things just to be pre-made so not to worry about him
53
00:03:19,936 --> 00:03:21,984
So there's one thing about the
54
00:03:22,240 --> 00:03:25,056
Camera that actually like to clean up a little bit
55
00:03:25,824 --> 00:03:28,640
I don't want to play any smack DAB in the centre
56
00:03:28,896 --> 00:03:29,920
The camera
57
00:03:30,432 --> 00:03:34,272
So what you can do is actually go over to your cinemachine virtual camera
58
00:03:35,296 --> 00:03:38,624
Go to the component here and take a look at the inspector
59
00:03:39,136 --> 00:03:40,416
We can actually
60
00:03:41,184 --> 00:03:42,208
Shift
61
00:03:42,720 --> 00:03:44,000
The why
62
00:03:44,256 --> 00:03:50,400
Of the screen a little bit too bad here we just make it 0.65
63
00:03:51,936 --> 00:03:53,984
Ok so that's good
64
00:03:54,240 --> 00:03:56,800
Now usually when you exit play mode
65
00:03:57,312 --> 00:03:59,360
Values going to go back to its original
66
00:04:00,128 --> 00:04:03,712
Because there's this little box here called save during play
67
00:04:03,968 --> 00:04:07,808
Is a convenient way for you to actually manipulate values
68
00:04:10,624 --> 00:04:16,768
In when you exit play mode you can see it's PT 68 when we exit play mode in actually saves that Valley
69
00:04:17,280 --> 00:04:18,047
Medical
70
00:04:18,559 --> 00:04:20,863
Turn around this 2.65
71
00:04:21,631 --> 00:04:27,775
0.65 5-year and hit save so now we have a camera
72
00:04:28,031 --> 00:04:31,359
Follows the player with a little bit of Ayr set
73
00:04:31,871 --> 00:04:34,943
And even if I jump all the way down
74
00:04:35,455 --> 00:04:41,599
Cameras get a follow the player at least he's going to try to the players falling a little bit faster
75
00:04:41,855 --> 00:04:43,135
And what the why did happen
76
00:04:43,391 --> 00:04:44,415
Allows for
77
00:04:44,927 --> 00:04:47,999
So that's the camera it's really that simple
78
00:04:49,023 --> 00:04:55,167
It's so let's go ahead and start creating a world we have player movement we have jumping we have the camera
79
00:04:55,423 --> 00:04:56,191
In the player
80
00:04:56,447 --> 00:04:59,007
So what are we just go ahead and start creating a world
81
00:04:59,263 --> 00:05:03,359
Why time I'm starting the Creator world I like to make it much space as possible
82
00:05:03,615 --> 00:05:04,639
We'll have some fun
83
00:05:04,895 --> 00:05:05,919
Tell
84
00:05:06,175 --> 00:05:07,455
About something like this
85
00:05:07,967 --> 00:05:14,111
Alright so we can start paying around member painting is clicking the middle or the right of your mouth
86
00:05:14,879 --> 00:05:16,671
Zoom using a scroll wheel
87
00:05:16,927 --> 00:05:18,463
Just a quick refresher there
88
00:05:19,231 --> 00:05:21,791
Select our ground one
89
00:05:22,559 --> 00:05:26,655
We can copy and paste it all over the place if we wanted to create a world
90
00:05:27,167 --> 00:05:28,959
What would I be careful here
91
00:05:29,215 --> 00:05:30,495
Anytime
92
00:05:30,751 --> 00:05:32,799
NY Times has a really good Bulls Tom
93
00:05:33,055 --> 00:05:35,871
Anytime you stop copying and pasting an object
94
00:05:37,151 --> 00:05:37,663
Pink
95
00:05:37,919 --> 00:05:39,455
Should this be a prefab
96
00:05:39,711 --> 00:05:45,855
Remember a prefab is something you can use over and over and over again and if you make a little tweet to it
97
00:05:46,111 --> 00:05:48,671
Is going to eat every single one that you pasted
98
00:05:48,927 --> 00:05:55,071
Somehow wanted to actually make this a little bit more rectangular maybe I wanted to do some
99
00:05:55,327 --> 00:05:56,351
Like this
100
00:05:56,863 --> 00:06:00,191
And I wanted it to apply to every ground in the game
101
00:06:01,471 --> 00:06:03,263
Ego
102
00:06:03,519 --> 00:06:06,335
Crap I should have made it a prefab
103
00:06:06,591 --> 00:06:08,639
So what I'm going to do is
104
00:06:09,151 --> 00:06:11,455
Make ground 1 a prefab
105
00:06:11,711 --> 00:06:13,759
Does create a new folder
106
00:06:14,015 --> 00:06:17,343
I'm going to create a new folder called prefabs
107
00:06:18,111 --> 00:06:19,647
Let's make sure that beds
108
00:06:19,903 --> 00:06:21,183
At the root level here
109
00:06:21,695 --> 00:06:24,255
In holiday do is drag round one
110
00:06:24,767 --> 00:06:25,535
Prefabs
111
00:06:26,303 --> 00:06:29,631
Can you see the return blue and now we have a prefab
112
00:06:29,887 --> 00:06:32,191
It means that I can copy and paste
113
00:06:32,703 --> 00:06:33,727
Ground
114
00:06:33,983 --> 00:06:35,519
All over the place
115
00:06:36,031 --> 00:06:39,103
Create this move a little bit here
116
00:06:39,359 --> 00:06:43,199
You know of an even better way to do this is actually to select the rectal
117
00:06:44,479 --> 00:06:47,039
Indus start copying pasting
118
00:06:47,295 --> 00:06:49,087
It always feels like you're in a
119
00:06:49,343 --> 00:06:52,415
Visual editing tool like illustrator Photoshop
120
00:06:52,927 --> 00:06:55,743
And how we can even rotates on that one and two
121
00:06:58,047 --> 00:06:59,071
Very cool
122
00:07:00,095 --> 00:07:01,375
Just create
123
00:07:01,631 --> 00:07:02,399
Our world
124
00:07:02,655 --> 00:07:06,239
Maybe have a little gap here will danger zone
125
00:07:06,495 --> 00:07:10,591
And just pay some all over the place you can see they're all blue here
126
00:07:11,103 --> 00:07:17,247
So what is that mean well if we actually could this area here for any of them it's going to take us to our prefab
127
00:07:17,503 --> 00:07:19,551
Meaning the original
128
00:07:20,063 --> 00:07:22,111
The original Game object
129
00:07:22,367 --> 00:07:26,207
That informs every other game of liquid just pasted
130
00:07:26,463 --> 00:07:30,815
What it should look like if I wanted to I could actually go you know what
131
00:07:31,327 --> 00:07:33,887
Can I want this to be a little bit long
132
00:07:34,399 --> 00:07:36,191
I can click the back arrow
133
00:07:36,447 --> 00:07:39,263
Save it and look all of them are rectangular
134
00:07:41,055 --> 00:07:42,335
To go back
135
00:07:42,591 --> 00:07:48,735
And again click any of the arrows in a take us to the original prefab and I seen and I never mind let's make it 1
136
00:07:49,503 --> 00:07:51,039
Go back and save
137
00:07:51,807 --> 00:07:53,087
Is back to the way it was
138
00:07:53,855 --> 00:07:58,719
You can imagine y That's really useful again you want to be able to change every single game object
139
00:07:58,975 --> 00:08:02,559
The game best way to do that is through a prefab
140
00:08:02,815 --> 00:08:05,119
If you want to just change one of them
141
00:08:05,375 --> 00:08:07,423
You can change one of them here
142
00:08:08,191 --> 00:08:12,287
Instead of adding the root prefab you're just editing the prefab itself
143
00:08:13,055 --> 00:08:17,407
Scaling over if it doesn't make sense I promise it makes sense with practice
144
00:08:18,943 --> 00:08:20,223
So that looks great
145
00:08:20,735 --> 00:08:24,575
Gohenry play and see how the game looks
146
00:08:25,599 --> 00:08:27,135
Bring this up a little bit
147
00:08:28,159 --> 00:08:30,207
That's awesome we're going to selves
148
00:08:30,975 --> 00:08:33,791
Decent platformer not in crazy hair but it works
149
00:08:34,559 --> 00:08:36,607
In the cameras following the player
150
00:08:37,375 --> 00:08:38,399
Very.co
151
00:08:40,447 --> 00:08:46,591
I just a quick tip here guys if you ever see random errors being thrown
152
00:08:46,847 --> 00:08:48,383
Now you're working on your game
153
00:08:49,407 --> 00:08:52,991
I keep getting thrown every time I paste a new object
154
00:08:53,759 --> 00:08:56,831
I'm sure there's a solution here for why bees are appearing
155
00:08:57,087 --> 00:09:03,231
But this is a part for the course working with unity so don't panic if you see random errors
156
00:09:03,487 --> 00:09:09,631
Being thrown in your console window we can simply clear a mouth we keep pasting in
157
00:09:09,887 --> 00:09:13,727
Are you going to see these errors appearing and honestly I don't even know why they are appearing
158
00:09:14,239 --> 00:09:17,311
But just remember you don't have to pay NIC
159
00:09:17,567 --> 00:09:20,127
You can hit play and everything is working ok
160
00:09:20,639 --> 00:09:26,783
Is probably some weird bug with the recent version of Unity in a proper be patched infix
161
00:09:27,039 --> 00:09:27,807
With an update
162
00:09:28,319 --> 00:09:34,463
You turn me Google what the problem is in my case and probably going to Google after recording this video to figure
163
00:09:34,719 --> 00:09:36,255
What's going on but
164
00:09:36,511 --> 00:09:37,791
All in all
165
00:09:38,047 --> 00:09:44,191
Don't stress too much just borrow for the course with unity
166
00:09:44,447 --> 00:09:47,263
We can just copy there's paste it over here maybe
167
00:09:48,031 --> 00:09:49,567
Scaling up
168
00:09:49,823 --> 00:09:50,847
Is it again
169
00:09:51,359 --> 00:09:52,383
Scaling app
170
00:09:53,151 --> 00:09:55,455
And if we hit play here
171
00:09:58,783 --> 00:10:00,844
You notice that we can run to the right
172
00:10:00,845 --> 00:10:03,528
Subtitled by
-♪ online-courses.club ♪-
We compress knowledge for you!
https://t.me/joinchat/ailxpXoW3JVjYzQ1
173
00:10:03,529 --> 00:10:04,927
And there is a boundary of a here
174
00:10:06,207 --> 00:10:08,255
Now one of the camera stop
175
00:10:08,767 --> 00:10:10,047
Abbas boundary
176
00:10:10,815 --> 00:10:12,351
Actually really simple
177
00:10:12,607 --> 00:10:14,911
Will add a camera confiner
178
00:10:16,191 --> 00:10:18,495
To our cinemachine virtual camera
179
00:10:19,007 --> 00:10:21,823
Call Dan extensions if you go all the way to the bottom here
180
00:10:22,591 --> 00:10:24,127
Canal extension
181
00:10:24,895 --> 00:10:26,431
We can add a confiner
182
00:10:27,967 --> 00:10:29,503
Collapsed
183
00:10:31,039 --> 00:10:33,855
It says a bounding shape is required
184
00:10:34,623 --> 00:10:37,951
What are that means it needs a collider2d
185
00:10:38,463 --> 00:10:39,743
What is the recall
186
00:10:39,999 --> 00:10:41,791
We have a collider2d
187
00:10:42,303 --> 00:10:43,327
Underground
188
00:10:44,095 --> 00:10:44,863
Prefab
189
00:10:45,887 --> 00:10:51,519
Actually just create an empty gameobject and add same type of Collider
190
00:10:52,799 --> 00:10:55,615
To this empty gameobject when you can see a default
191
00:10:57,407 --> 00:10:59,199
To adding a pentagon
192
00:10:59,967 --> 00:11:01,759
To our game object
193
00:11:02,015 --> 00:11:04,063
And we can actually just Collider
194
00:11:05,087 --> 00:11:08,927
By clicking the Edit Collider button and just moving shape
195
00:11:10,463 --> 00:11:11,487
Excel
196
00:11:11,999 --> 00:11:15,327
So basically what we're doing is a drawing the boundaries
197
00:11:15,839 --> 00:11:17,119
Or a camera
198
00:11:17,375 --> 00:11:19,167
So we can have a go pretty high
199
00:11:22,495 --> 00:11:28,639
And if it isn't like this I don't really need this if I press control and holiday
200
00:11:28,895 --> 00:11:30,687
No second click in deleted
201
00:11:31,967 --> 00:11:33,247
Now we have
202
00:11:33,503 --> 00:11:34,527
4 points
203
00:11:35,039 --> 00:11:37,343
And what if we want to the camera
204
00:11:38,623 --> 00:11:39,903
To follow
205
00:11:41,439 --> 00:11:42,975
Just above
206
00:11:44,767 --> 00:11:45,791
The squares
207
00:11:46,815 --> 00:11:48,095
I mean we don't have to
208
00:11:48,607 --> 00:11:53,471
Copy and paste the squares more below in create more game objects
209
00:11:54,239 --> 00:11:58,335
It will look as if there is a buildings below even though
210
00:11:58,847 --> 00:11:59,871
What we can see
211
00:12:00,383 --> 00:12:03,199
Is actually nothing below the camera boundaries
212
00:12:03,711 --> 00:12:06,783
Play here and see what happens
213
00:12:10,879 --> 00:12:12,415
The Glitch
214
00:12:13,439 --> 00:12:14,975
What is that what's going on
215
00:12:15,487 --> 00:12:16,511
Well
216
00:12:16,767 --> 00:12:19,583
What we just created is actually a Collider right
217
00:12:20,351 --> 00:12:21,631
So we can think about it
218
00:12:22,143 --> 00:12:23,935
Players actually stuck
219
00:12:24,191 --> 00:12:27,263
Inside of this Collider and it doesn't know what to do
220
00:12:27,519 --> 00:12:28,799
How we fix that
221
00:12:29,311 --> 00:12:30,591
Exit play mode
222
00:12:31,359 --> 00:12:32,127
Inlets
223
00:12:33,151 --> 00:12:34,431
Click on our
224
00:12:34,943 --> 00:12:36,991
Polygon Collider game object here
225
00:12:37,759 --> 00:12:40,575
Actually said it to his Trigger
226
00:12:41,343 --> 00:12:42,623
Where is that a true
227
00:12:43,391 --> 00:12:49,279
That means there is no longer actually going to collide with anything rather it's just going to be a Trigger
228
00:12:49,535 --> 00:12:50,559
Play
229
00:12:52,095 --> 00:12:57,983
There we go OK cool looks like the players able to fall through the collider that's great
230
00:13:01,311 --> 00:13:04,639
Looks like the camera is an actually following the rules
231
00:13:07,967 --> 00:13:08,991
Polygon Collider
232
00:13:10,271 --> 00:13:11,807
That's because we forgot
233
00:13:12,575 --> 00:13:13,855
How to drag car
234
00:13:14,623 --> 00:13:15,647
Lighter
235
00:13:15,903 --> 00:13:17,439
The bounding shape 2D
236
00:13:18,463 --> 00:13:24,607
Just dragged out in in now the camera is going to be stuck within the confines of this
237
00:13:24,863 --> 00:13:25,631
Collider
238
00:13:26,655 --> 00:13:31,007
Let's be sure to rename a gameobject just for saying to be really cold this
239
00:13:32,031 --> 00:13:34,591
Polygon
240
00:13:35,359 --> 00:13:36,127
Camera
241
00:13:38,431 --> 00:13:39,199
Collider
242
00:13:39,455 --> 00:13:45,599
Can I put spaces in between each word that's fine and I like to drag things next to each other
243
00:13:46,111 --> 00:13:49,439
We are main camera a virtual camera and we also have
244
00:13:50,207 --> 00:13:51,743
The camera Collider
245
00:13:53,023 --> 00:13:54,559
You better word is probably
246
00:13:55,071 --> 00:13:56,095
Confiner
247
00:13:58,143 --> 00:13:59,935
Ok let's see what happens
248
00:14:04,287 --> 00:14:05,567
What site for camera
249
00:14:07,103 --> 00:14:09,151
Can move in the extraction
250
00:14:09,663 --> 00:14:12,991
Sky Direction why is that
251
00:14:13,503 --> 00:14:17,343
That's because the camera if you think about this white box here
252
00:14:17,599 --> 00:14:20,671
As basically being a Collider in itself
253
00:14:21,439 --> 00:14:25,023
You know that corner is actually getting caught
254
00:14:26,047 --> 00:14:27,583
On this portion here
255
00:14:28,607 --> 00:14:32,191
So what we need to do is actually just expanded down
256
00:14:35,007 --> 00:14:37,823
The carer has a little bit more wiggle room
257
00:14:38,847 --> 00:14:40,127
To move around
258
00:14:42,687 --> 00:14:44,735
How to delete a couple of years
259
00:14:45,247 --> 00:14:47,551
Vertices year cos it's getting a little bit messy
260
00:14:48,575 --> 00:14:52,415
I think a shaped like this is probably just fine
261
00:14:53,439 --> 00:14:54,207
UK
262
00:14:54,719 --> 00:15:00,863
What is does mean is we probably need a fill in these holes a little bit so I'm going to use the recto
263
00:15:01,631 --> 00:15:03,423
I just drag him over little bit
264
00:15:06,751 --> 00:15:10,591
Sometimes you do need to do a little bit of walking like this
265
00:15:11,615 --> 00:15:12,895
Just to ensure
266
00:15:13,407 --> 00:15:15,199
Play feels like there now
267
00:15:17,247 --> 00:15:18,783
Really flushed out world
268
00:15:19,551 --> 00:15:20,831
Ego
269
00:15:21,087 --> 00:15:25,183
A little bit of a way of doing it but I think you get the point
270
00:15:26,207 --> 00:15:27,487
Alright
271
00:15:27,999 --> 00:15:30,815
So now we have our polygon Collider
272
00:15:33,119 --> 00:15:35,679
And we should have plenty of room here but
273
00:15:35,935 --> 00:15:38,239
Let's just move this after so little bit as well
274
00:15:38,495 --> 00:15:41,055
Plenty of room for the camera to move
275
00:15:41,567 --> 00:15:43,103
Go ahead in hip play
276
00:15:52,575 --> 00:15:55,903
Tell us a camera stops where we needed to that's great
277
00:15:56,159 --> 00:15:57,951
And if we don't fall down
278
00:16:00,255 --> 00:16:01,791
The player will keep falling
279
00:16:02,303 --> 00:16:05,631
Camera stop when you can see that the player is
280
00:16:05,887 --> 00:16:11,007
His phone fast I can't even find them but he's falling in the camera has stopped
281
00:16:11,775 --> 00:16:17,919
That's how we can find them
21293
Can't find what you're looking for?
Get subtitles in any language from opensubtitles.com, and translate them here.