Would you like to inspect the original subtitles? These are the user uploaded subtitles that are being translated:
1
00:00:00,256 --> 00:00:06,400
As part of a general effort to make the game looking feel better one of the things that has been bothering me
2
00:00:06,656 --> 00:00:09,984
Is the fact that our vials of experience
3
00:00:10,496 --> 00:00:12,800
Orange End at all day just kind
4
00:00:13,056 --> 00:00:14,848
Disappear when the player collapse
5
00:00:15,360 --> 00:00:15,872
Soul
6
00:00:16,128 --> 00:00:17,664
Make that little
7
00:00:17,920 --> 00:00:18,944
More
8
00:00:19,456 --> 00:00:24,320
What's open up our vile experience or experience Vale weather
9
00:00:25,088 --> 00:00:26,368
And we'll take a look at this scene
10
00:00:26,880 --> 00:00:28,160
And open up the Script
11
00:00:28,416 --> 00:00:31,744
So remaining this experience by are collected and then
12
00:00:32,000 --> 00:00:33,280
Q-free in the van
13
00:00:33,536 --> 00:00:35,584
That was kind of unsatisfying is there
14
00:00:35,840 --> 00:00:36,352
It's just
15
00:00:36,608 --> 00:00:37,120
Disappear
16
00:00:37,632 --> 00:00:41,728
What we're going to do is we're going to make it actually fly toward the player
17
00:00:42,240 --> 00:00:46,080
And perhaps we'll give it some sort of rotation or something
18
00:00:46,592 --> 00:00:47,104
That need
19
00:00:47,616 --> 00:00:48,128
As well
20
00:00:48,384 --> 00:00:50,176
So we're going to be using tween
21
00:00:50,432 --> 00:00:53,760
Again for this and the reason is because
22
00:00:54,016 --> 00:00:57,600
It's very easy to use tweens to animate between two variable position
23
00:00:58,112 --> 00:00:59,904
And in this case we're going to end
24
00:01:00,123 --> 00:01:02,363
Subtitled by
online-courses.club
We compress knowledge for you!
25
00:01:02,364 --> 00:01:00,672
Between
26
00:01:00,928 --> 00:01:02,976
The position of the experience
27
00:01:03,488 --> 00:01:04,768
To the position of the player
28
00:01:05,792 --> 00:01:06,816
Keeping in mind
29
00:01:07,072 --> 00:01:08,352
The player position will
30
00:01:08,608 --> 00:01:09,120
Very
31
00:01:09,376 --> 00:01:10,656
In other words it will change
32
00:01:11,168 --> 00:01:13,984
While the player is moving and the violins flying towards
33
00:01:14,496 --> 00:01:16,544
In our on area entered
34
00:01:16,800 --> 00:01:17,312
Signal
35
00:01:17,824 --> 00:01:19,360
Let's start by
36
00:01:19,616 --> 00:01:20,128
Creating
37
00:01:22,176 --> 00:01:22,944
Between
38
00:01:23,200 --> 00:01:24,480
Is equal to create
39
00:01:24,992 --> 00:01:25,504
Twin
40
00:01:26,784 --> 00:01:28,832
I'm going to do is were going to say twin
41
00:01:29,088 --> 00:01:29,600
Dart
42
00:01:29,856 --> 00:01:31,648
Between underscore
43
00:01:32,160 --> 00:01:34,976
Let's say let's call it tween underscore
44
00:01:35,488 --> 00:01:39,328
And before we go any further let's Create that function so funk
45
00:01:40,608 --> 00:01:41,888
Tween underscore
46
00:01:42,400 --> 00:01:43,680
We're going to send a couple of
47
00:01:43,936 --> 00:01:45,472
Of argument here first
48
00:01:45,728 --> 00:01:49,312
The thing is going to come in is our interpolated value from
49
00:01:49,568 --> 00:01:50,080
Between
50
00:01:50,336 --> 00:01:52,384
This case is going to rappers
51
00:01:53,152 --> 00:01:53,664
Possess
52
00:01:54,176 --> 00:01:55,200
Which is of Type 4
53
00:01:55,968 --> 00:01:58,784
And then we're going to pass in the start position
54
00:02:00,064 --> 00:02:02,112
What is going to be of type vector2
55
00:02:02,368 --> 00:02:03,392
And the
56
00:02:03,904 --> 00:02:06,464
Well actually they should just be fine so just to start
57
00:02:06,976 --> 00:02:08,256
And you'll see how this is all going to work
58
00:02:08,512 --> 00:02:10,304
In a second year so let's just write pass
59
00:02:10,816 --> 00:02:12,608
So you've got a twin collect method
60
00:02:12,864 --> 00:02:16,192
Which is going to be past the percent which is what we're going to be twins
61
00:02:16,448 --> 00:02:17,728
And then I'll start
62
00:02:18,496 --> 00:02:19,776
So this is how this is gonna work
63
00:02:20,032 --> 00:02:20,800
So we've got
64
00:02:21,056 --> 00:02:21,568
Tween
65
00:02:21,824 --> 00:02:22,592
Screen mesh
66
00:02:23,104 --> 00:02:25,920
And if we control click into this we can see that
67
00:02:26,176 --> 00:02:30,528
When you do is pass in a callable which is basically a reference to a mesh
68
00:02:30,784 --> 00:02:31,808
Which we've setup
69
00:02:32,064 --> 00:02:35,136
And a from na to na
70
00:02:35,648 --> 00:02:38,464
What I like to do for this kind of thing is
71
00:02:38,720 --> 00:02:39,744
We have the twinkle
72
00:02:40,256 --> 00:02:42,560
Will revisit twinkle like in a second
73
00:02:42,816 --> 00:02:46,144
I want to go from 0.0 to 1.0
74
00:02:46,400 --> 00:02:47,424
Because this is from
75
00:02:47,680 --> 00:02:49,728
0% to 100%
76
00:02:49,984 --> 00:02:50,752
Basically
77
00:02:51,008 --> 00:02:55,616
In our generation let's do something like which is do one second that should be fine
78
00:02:55,872 --> 00:02:57,152
Now there's twinkl
79
00:02:57,664 --> 00:02:58,944
What's going to be passed in
80
00:02:59,200 --> 00:03:04,320
Guaranteed is this percent which will be anywhere between 0 and 1 depending on how far between is
81
00:03:04,576 --> 00:03:05,600
In progress
82
00:03:05,856 --> 00:03:07,648
Just want to pass the start position
83
00:03:08,160 --> 00:03:10,464
And in order to do that we have to do this
84
00:03:10,976 --> 00:03:12,768
Right to buy
85
00:03:13,024 --> 00:03:16,864
And then our start position is going to be our global position
86
00:03:18,400 --> 00:03:19,680
Now what are we going to do with the cinema
87
00:03:19,936 --> 00:03:20,960
So
88
00:03:21,216 --> 00:03:25,568
Storing a snapshot of the global position of this experience vile
89
00:03:25,824 --> 00:03:26,336
Set the timer
90
00:03:26,592 --> 00:03:27,360
Is quite good by the play
91
00:03:27,872 --> 00:03:31,200
This will all will be passed in every single time
92
00:03:31,456 --> 00:03:32,224
As a position
93
00:03:32,480 --> 00:03:33,760
To twinkle
94
00:03:34,272 --> 00:03:37,088
And in here what we're gonna do is we're going to grab the player
95
00:03:37,600 --> 00:03:39,904
Via player is equal to get 3
96
00:03:40,160 --> 00:03:42,208
Get first node in group
97
00:03:42,464 --> 00:03:42,976
Claire
98
00:03:44,256 --> 00:03:47,840
Claire is he good to know I will just return right out of that
99
00:03:48,096 --> 00:03:49,376
Just for safety purpose
100
00:03:49,888 --> 00:03:51,168
I know we've got this percent
101
00:03:51,424 --> 00:03:53,984
And we're going to use a vector tool
102
00:03:54,240 --> 00:03:54,752
Again
103
00:03:55,008 --> 00:03:56,288
So we're going to take
104
00:03:56,544 --> 00:03:57,056
The
105
00:03:57,312 --> 00:03:58,336
Global position
106
00:03:59,872 --> 00:04:01,664
Of the career of the note currently
107
00:04:01,920 --> 00:04:02,944
Is equal to
108
00:04:03,456 --> 00:04:05,760
Start positions of this is the position
109
00:04:06,016 --> 00:04:06,784
At which
110
00:04:07,040 --> 00:04:08,064
Civil War
111
00:04:08,320 --> 00:04:10,112
When the collection started
112
00:04:11,136 --> 00:04:11,648
Learn
113
00:04:11,904 --> 00:04:15,232
To the player global position
114
00:04:16,000 --> 00:04:20,095
And our weight is going to be the percent value that's coming in
115
00:04:20,607 --> 00:04:21,375
To the mass
116
00:04:21,887 --> 00:04:25,983
Another word for using the twin to control the duration
117
00:04:26,239 --> 00:04:28,543
How long it takes to go from 0 to 1%
118
00:04:28,799 --> 00:04:30,591
And were passing that in
119
00:04:30,847 --> 00:04:31,871
To the law
120
00:04:32,383 --> 00:04:34,687
And using that to calculate the new global
121
00:04:35,199 --> 00:04:36,223
So you can imagine
122
00:04:36,479 --> 00:04:39,039
It's going to take a number of frames
123
00:04:39,551 --> 00:04:41,343
For the collect enemy
124
00:04:41,599 --> 00:04:42,111
To finish
125
00:04:42,367 --> 00:04:44,671
While that's happening the player is going to be me
126
00:04:45,183 --> 00:04:47,743
And so we have to constantly be using the law
127
00:04:47,999 --> 00:04:49,279
Between the player position
128
00:04:49,535 --> 00:04:51,583
And we have to use the start position
129
00:04:51,839 --> 00:04:52,351
The route
130
00:04:52,607 --> 00:04:54,399
We can't use the current global position
131
00:04:54,655 --> 00:04:55,679
Because that
132
00:04:55,935 --> 00:04:56,447
That would not
133
00:04:57,983 --> 00:04:58,751
That's what we
134
00:04:59,263 --> 00:05:02,591
And then we can do something like this so we can write tween
135
00:05:02,847 --> 00:05:05,151
Between call back which will call a mess
136
00:05:05,407 --> 00:05:07,967
After the previous tweener is fine
137
00:05:08,479 --> 00:05:09,247
And we're going to call
138
00:05:09,503 --> 00:05:10,015
Q3
139
00:05:11,551 --> 00:05:13,087
And actually let's do this
140
00:05:14,623 --> 00:05:15,647
Create a new function
141
00:05:16,415 --> 00:05:17,183
Call Colette
142
00:05:17,695 --> 00:05:19,999
And in here we're going to call queue free
143
00:05:21,791 --> 00:05:25,119
Light above that were going to use this game events in May
144
00:05:25,375 --> 00:05:28,191
Experience by collecting so cut and paste it there
145
00:05:28,447 --> 00:05:31,519
Make sure to remove the Q3 from this on area entered
146
00:05:31,775 --> 00:05:33,311
And then in the screen called
147
00:05:33,567 --> 00:05:35,103
Let's use collect instead
148
00:05:36,383 --> 00:05:39,455
So this twin method is going to run for one second
149
00:05:39,711 --> 00:05:42,015
It's going to lerp between the
150
00:05:42,271 --> 00:05:44,063
Position at which it was picked up
151
00:05:44,319 --> 00:05:46,367
To the player position every frame
152
00:05:46,879 --> 00:05:48,415
Using the present that passed in
153
00:05:48,671 --> 00:05:50,207
And then it will call collect
154
00:05:51,231 --> 00:05:53,279
We should be good so let's go ahead and Run the game
155
00:05:53,535 --> 00:05:55,839
And see what that looks like we need it
156
00:05:56,095 --> 00:05:56,607
Add some veg
157
00:05:56,863 --> 00:05:57,375
So
158
00:05:57,631 --> 00:05:58,143
Let's
159
00:05:58,399 --> 00:05:59,167
Kill some rats
160
00:06:00,447 --> 00:06:01,215
And there you go
161
00:06:01,471 --> 00:06:03,775
You should start seeing at the vials or
162
00:06:04,031 --> 00:06:06,335
Being collected now when you run over there
163
00:06:06,591 --> 00:06:08,383
But they still don't look
164
00:06:08,639 --> 00:06:09,407
Super cool
165
00:06:09,919 --> 00:06:12,991
So what we can do is there is additional stuff we can do
166
00:06:13,247 --> 00:06:13,759
Please twins
167
00:06:14,015 --> 00:06:14,783
We can set
168
00:06:15,039 --> 00:06:15,551
Easy
169
00:06:15,807 --> 00:06:16,831
And we can see
170
00:06:18,623 --> 00:06:22,463
This is a very handy website this is called easons.ie
171
00:06:22,719 --> 00:06:26,303
And I will link this as a resource to this lesson
172
00:06:26,815 --> 00:06:32,447
What does is this shows you a graphical and interactive representation of all the diff
173
00:06:32,703 --> 00:06:36,543
Easing functions now using functions are something that are very common across
174
00:06:36,799 --> 00:06:37,311
Ok
175
00:06:37,567 --> 00:06:39,871
Animation and game development software
176
00:06:40,127 --> 00:06:42,431
So these are more or less standardised
177
00:06:42,943 --> 00:06:48,063
The nice thing about this is that you can hover over it to see what their behaviour look
178
00:06:49,087 --> 00:06:52,159
Until we can use this to figure out how we want
179
00:06:52,415 --> 00:06:52,927
H
180
00:06:53,439 --> 00:06:54,975
Vial to swing towards
181
00:06:55,487 --> 00:06:56,511
What I'm thinking
182
00:06:56,767 --> 00:06:59,583
Is we might use an ease in Bath
183
00:07:00,095 --> 00:07:00,863
Like a voice
184
00:07:01,119 --> 00:07:02,143
So that the vile
185
00:07:02,399 --> 00:07:05,471
Kind of get shaved away from the player first and then comes back
186
00:07:05,727 --> 00:07:08,287
So let's use the easing back and you can hover over
187
00:07:08,543 --> 00:07:09,823
To see exactly how that's gonna look
188
00:07:10,079 --> 00:07:11,871
Or what that's going to feel like at least
189
00:07:12,127 --> 00:07:13,919
So we got back to good doll
190
00:07:14,175 --> 00:07:15,967
In here we can do at the end of the screen
191
00:07:17,247 --> 00:07:17,759
Start
192
00:07:19,039 --> 00:07:19,551
Is
193
00:07:19,807 --> 00:07:22,879
And then it will give you some auto suggestions we're going to you
194
00:07:23,391 --> 00:07:25,695
Between is in because
195
00:07:25,951 --> 00:07:27,231
Going back to our
196
00:07:27,487 --> 00:07:28,767
Is in back
197
00:07:29,279 --> 00:07:30,047
The east height
198
00:07:31,071 --> 00:07:32,863
And then the transition type will be
199
00:07:33,119 --> 00:07:34,655
So we're going to go to
200
00:07:34,911 --> 00:07:37,983
That line again we've got set use and rights
201
00:07:39,263 --> 00:07:41,311
Trans and then tween doll
202
00:07:41,823 --> 00:07:42,335
Trans
203
00:07:42,591 --> 00:07:43,103
Jack
204
00:07:44,383 --> 00:07:45,663
And this line is a little
205
00:07:45,919 --> 00:07:46,431
Big
206
00:07:46,687 --> 00:07:50,783
For me on my own so one quick tip as you can use a backslash
207
00:07:53,087 --> 00:07:55,135
Newlines you can make multi line
208
00:07:55,647 --> 00:07:57,695
Statements by doing a backslash
209
00:07:57,951 --> 00:07:59,231
And then continue on the net
210
00:07:59,999 --> 00:08:02,559
This is saying is this is essentially all
211
00:08:02,815 --> 00:08:06,911
Supposed to be on the same line that because guedel uses whitespace as away
212
00:08:07,167 --> 00:08:07,935
Determine
213
00:08:08,191 --> 00:08:08,959
Blacks
214
00:08:09,215 --> 00:08:10,239
You actually need to me
215
00:08:10,495 --> 00:08:11,007
When
216
00:08:11,263 --> 00:08:13,311
Whitespace line
217
00:08:13,567 --> 00:08:14,079
Should be
218
00:08:14,335 --> 00:08:14,847
Continuation
219
00:08:15,103 --> 00:08:17,151
So we got the settees and set trans
220
00:08:17,407 --> 00:08:18,943
So let's go ahead and see
221
00:08:19,455 --> 00:08:21,759
What that looks like when we collect a vile
222
00:08:22,015 --> 00:08:22,527
From
223
00:08:23,039 --> 00:08:23,551
A rat
224
00:08:25,855 --> 00:08:27,391
Alright that looks really great
225
00:08:28,671 --> 00:08:29,695
Let's turn the
226
00:08:29,951 --> 00:08:31,743
Direction down to .5
227
00:08:32,767 --> 00:08:36,095
Instead of one so that's the 3rd or the 4th of
228
00:08:36,351 --> 00:08:37,119
And here weather
229
00:08:37,375 --> 00:08:40,447
Let's rotate the vile according to the direction
230
00:08:40,703 --> 00:08:42,495
That is between
231
00:08:42,751 --> 00:08:44,031
Start position
232
00:08:44,287 --> 00:08:48,127
The players global position of our current global position
233
00:08:48,639 --> 00:08:49,151
So
234
00:08:49,663 --> 00:08:50,943
We want to say
235
00:08:51,199 --> 00:08:53,247
What's the new variable via Direction
236
00:08:53,759 --> 00:08:54,271
From
237
00:08:54,527 --> 00:08:57,087
Start underneath the position is equal to
238
00:08:57,599 --> 00:09:00,159
Global positions for the current global position
239
00:09:00,671 --> 00:09:01,439
-2
240
00:09:01,695 --> 00:09:02,207
Position
241
00:09:03,231 --> 00:09:07,071
And now we're going to set the rotations were going to say rotation
242
00:09:07,327 --> 00:09:08,351
Is equal to
243
00:09:09,119 --> 00:09:09,887
Directions
244
00:09:10,143 --> 00:09:11,935
From start
245
00:09:12,447 --> 00:09:16,287
Now what I'm going to do is I'm going to comment out this game events in
246
00:09:16,543 --> 00:09:18,335
Experienced by all collected line
247
00:09:18,591 --> 00:09:21,407
And then I'm going to open up my basic anime scene
248
00:09:21,663 --> 00:09:23,455
Go to the Vale drop component
249
00:09:23,711 --> 00:09:26,015
And turn the drop percent up to 1
250
00:09:26,271 --> 00:09:28,575
And the reason why I'm doing both of those things
251
00:09:28,831 --> 00:09:31,135
Is just so that we can test the vials
252
00:09:31,391 --> 00:09:33,183
Without having to be interrupt
253
00:09:33,695 --> 00:09:35,743
Why is awaiting for a while to dry
254
00:09:35,999 --> 00:09:37,535
Or by level
255
00:09:38,047 --> 00:09:38,559
So
256
00:09:38,815 --> 00:09:40,607
Let's see what this looks
257
00:09:42,143 --> 00:09:45,215
And you can see that the rotation starts to work but there are a number of Prague
258
00:09:45,471 --> 00:09:47,007
It looks a little bit weird
259
00:09:47,263 --> 00:09:48,799
Not quite clear wires
260
00:09:49,311 --> 00:09:49,823
Looking
261
00:09:50,335 --> 00:09:51,871
And so there's a little bit of weird
262
00:09:52,127 --> 00:09:53,407
So the first bit of weird
263
00:09:53,919 --> 00:09:54,687
Is that
264
00:09:54,943 --> 00:09:56,735
When were using this angle
265
00:09:56,991 --> 00:09:59,039
So this is a this is an angle
266
00:09:59,295 --> 00:10:00,063
In rage
267
00:10:00,345 --> 00:10:02,376
Subtitled by
online-courses.club
We compress knowledge for you!
268
00:10:02,377 --> 00:10:03,135
Any can wrap it can go from positive to negative
269
00:10:03,391 --> 00:10:04,671
By crossing is
270
00:10:04,927 --> 00:10:07,231
Threshold which flips the entire thing of
271
00:10:07,743 --> 00:10:12,095
So we can take steps to address this first Let's Get It facing the right direction
272
00:10:12,351 --> 00:10:12,863
Because
273
00:10:13,119 --> 00:10:14,655
You'll notice to that device
274
00:10:15,167 --> 00:10:16,703
Facing straight up and down
275
00:10:17,215 --> 00:10:19,519
And that's a problem because
276
00:10:19,775 --> 00:10:23,615
Remember 0 degrees is represented by being to the right
277
00:10:24,127 --> 00:10:26,175
Until when we rotated to say
278
00:10:26,687 --> 00:10:27,199
Face
279
00:10:27,455 --> 00:10:28,991
Wednesday we wanted face
280
00:10:29,247 --> 00:10:30,783
Right we want to say facing the Opera
281
00:10:31,039 --> 00:10:33,087
It's actually going to be rotated like this
282
00:10:33,343 --> 00:10:36,671
Because that's 9 degrees you can see my rotation is -90
283
00:10:37,951 --> 00:10:38,975
So that's a problem
284
00:10:39,231 --> 00:10:41,535
That's all you need to do is when you do rotated by
285
00:10:41,791 --> 00:10:43,071
9 degrees a day
286
00:10:44,607 --> 00:10:47,423
The weather I'm going to do that is I am going to firstly
287
00:10:47,679 --> 00:10:48,191
Say
288
00:10:48,447 --> 00:10:54,591
Rotation degrees so rotation underscore degrees is equal to let's do a function called
289
00:10:54,847 --> 00:10:55,615
Add to date
290
00:10:56,127 --> 00:10:57,663
Which will convert radians to degrees
291
00:10:57,919 --> 00:11:00,735
What take that directions from star tango and put it in there
292
00:11:00,991 --> 00:11:02,527
And then we can add 9
293
00:11:02,783 --> 00:11:03,295
To it
294
00:11:03,551 --> 00:11:05,087
So that we can get that off set
295
00:11:06,623 --> 00:11:11,487
And then the other weird thing is our queen is actually being started twice
296
00:11:11,743 --> 00:11:12,767
Because
297
00:11:13,023 --> 00:11:15,839
This area2d is being entered twice
298
00:11:16,095 --> 00:11:16,863
Why are player
299
00:11:17,119 --> 00:11:18,143
Someone the vile
300
00:11:18,399 --> 00:11:19,423
Flies back
301
00:11:19,679 --> 00:11:20,703
When we collect it
302
00:11:20,959 --> 00:11:25,823
It exits the players detection Range and then it flies back into the players detection
303
00:11:26,335 --> 00:11:28,383
And that is causing the twin-to-twin
304
00:11:28,639 --> 00:11:32,479
Start which are fighting with each other and that's why it's never quite ending
305
00:11:32,991 --> 00:11:34,271
Add the players position
306
00:11:34,783 --> 00:11:36,063
So what we can do to fix it
307
00:11:36,319 --> 00:11:38,367
Is we simply need to disable
308
00:11:38,623 --> 00:11:39,903
Beer collision shape
309
00:11:40,159 --> 00:11:40,927
When
310
00:11:41,183 --> 00:11:42,719
The area is 4
311
00:11:43,999 --> 00:11:45,023
So let's go ahead and do it
312
00:11:45,535 --> 00:11:49,887
In the top here going to do an on ready and I'm going to use this neat little trick I'm gonna
313
00:11:50,143 --> 00:11:52,191
Click and drag on the collision
314
00:11:52,447 --> 00:11:53,983
2D in the area 2
315
00:11:54,239 --> 00:11:55,007
Now bring us all
316
00:11:55,263 --> 00:11:59,871
And then I'm going to hit control and hold control and then release my mouse button
317
00:12:00,127 --> 00:12:01,919
And I will generate and I'm ready for
318
00:12:02,431 --> 00:12:03,455
Collision shape
319
00:12:03,711 --> 00:12:04,223
2D
320
00:12:04,479 --> 00:12:08,063
Now me on area entered we want to set the collision shape 2D
321
00:12:08,319 --> 00:12:09,343
Disabled however
322
00:12:09,599 --> 00:12:13,439
We cannot do that in a physics callback that will give us an error
323
00:12:13,695 --> 00:12:17,279
You generally speaking cannot modify anything about collision shape
324
00:12:17,791 --> 00:12:20,863
In an on area entered or on body and turn
325
00:12:21,119 --> 00:12:21,631
Signal
326
00:12:21,887 --> 00:12:24,191
That is a special event that
327
00:12:24,703 --> 00:12:26,495
Good ol' warned you again Spotify
328
00:12:27,007 --> 00:12:28,799
Let's do this let's create a
329
00:12:29,311 --> 00:12:31,359
Function called disable
330
00:12:31,615 --> 00:12:32,383
Collision
331
00:12:33,407 --> 00:12:35,199
And then we're going to say
332
00:12:36,479 --> 00:12:39,039
Collision shape to the disabled
333
00:12:39,295 --> 00:12:40,575
Is equal to true
334
00:12:41,087 --> 00:12:43,647
And then in our honour enter
335
00:12:43,903 --> 00:12:44,927
Let's do
336
00:12:45,439 --> 00:12:46,207
Callable
337
00:12:46,463 --> 00:12:47,999
And then in parentheses
338
00:12:48,767 --> 00:12:50,303
A reference to disable
339
00:12:53,631 --> 00:12:54,399
And then we're going to call
340
00:12:54,911 --> 00:12:55,679
Call Dave
341
00:12:56,191 --> 00:12:59,775
So this will do is this a ok we want to call this method here
342
00:13:00,031 --> 00:13:00,543
But
343
00:13:00,799 --> 00:13:03,615
On the next idle frame so outside of the
344
00:13:03,871 --> 00:13:04,383
Physics
345
00:13:05,407 --> 00:13:06,175
Process
346
00:13:06,431 --> 00:13:09,503
So now let's go ahead and collect some vials and see if that
347
00:13:09,759 --> 00:13:11,039
Looks a little bit
348
00:13:13,343 --> 00:13:14,879
That's looking much nice
349
00:13:15,903 --> 00:13:17,695
Now I'm still getting some weirdness
350
00:13:17,951 --> 00:13:20,511
With the rotation I think it's mostly looking ok
351
00:13:20,767 --> 00:13:24,607
It's just it's pointing in the opposite direction when it does the first back
352
00:13:25,119 --> 00:13:26,399
So we can
353
00:13:26,911 --> 00:13:27,679
6
354
00:13:28,191 --> 00:13:30,495
I think the simple fix for that is just going to be
355
00:13:30,751 --> 00:13:32,799
To always point at the player
356
00:13:33,311 --> 00:13:34,591
Instead of pointing
357
00:13:34,847 --> 00:13:37,407
From the start position to the current global position
358
00:13:37,663 --> 00:13:39,711
Let's point from the start position to the
359
00:13:40,223 --> 00:13:41,759
Claire Lopez
360
00:13:44,319 --> 00:13:45,087
What's a flower
361
00:13:47,391 --> 00:13:48,415
Alright that's looking good
362
00:13:48,671 --> 00:13:51,743
And let's make this a little bit smooth
363
00:13:51,999 --> 00:13:54,559
By interpolating the rotation
364
00:13:55,327 --> 00:13:56,095
So let's do
365
00:13:56,863 --> 00:13:58,655
What's another variable called target
366
00:13:59,423 --> 00:14:01,215
Rotation degrees
367
00:14:01,727 --> 00:14:03,263
Let's copy this line
368
00:14:04,031 --> 00:14:05,311
Work at this line Rider
369
00:14:05,567 --> 00:14:06,591
And set
370
00:14:06,847 --> 00:14:08,895
The target rotation degrees equal to that line
371
00:14:09,407 --> 00:14:11,711
Never going to say rotation degrees is equal to
372
00:14:12,223 --> 00:14:12,991
Learn
373
00:14:13,247 --> 00:14:15,807
Which is just a normal function which allows is to learn
374
00:14:16,063 --> 00:14:16,575
Between
375
00:14:17,087 --> 00:14:20,159
Let's Learn between the current rotation degrees value
376
00:14:20,671 --> 00:14:22,719
And the target rotation degrees
377
00:14:23,487 --> 00:14:24,511
And our way
378
00:14:25,023 --> 00:14:27,583
Let's do that trick again 1 -
379
00:14:27,839 --> 00:14:28,607
Exp
380
00:14:28,863 --> 00:14:30,911
And then let's do negative
381
00:14:31,167 --> 00:14:31,679
Get
382
00:14:32,191 --> 00:14:32,959
Process
383
00:14:33,215 --> 00:14:33,727
What a time
384
00:14:33,983 --> 00:14:37,055
So again this is the framerate independent variable that we have been using
385
00:14:37,311 --> 00:14:40,639
And we don't actually want to use alert we want to use
386
00:14:41,151 --> 00:14:42,431
Angle instead
387
00:14:43,199 --> 00:14:48,319
And the reason is because this is essentially a special method that will handle smoothly interpolate
388
00:14:48,575 --> 00:14:49,087
Between
389
00:14:49,343 --> 00:14:49,855
When it
390
00:14:50,111 --> 00:14:50,623
Flips
391
00:14:50,879 --> 00:14:55,231
So there is a position there is a point where once you rotate past a certain point
392
00:14:55,487 --> 00:14:57,791
The sign of the angle actually flips
393
00:14:58,047 --> 00:14:59,839
And if you don't use alert angle
394
00:15:00,095 --> 00:15:03,167
Then you will see your angle just flipping incident
395
00:15:03,679 --> 00:15:09,567
At one point so you can play with it you can use a look and see what I'm talking about the angle is what you should be using when you're learning
396
00:15:09,823 --> 00:15:10,335
Angles
397
00:15:10,591 --> 00:15:15,199
When we use angle instead of work we actually have to convert these degrees
398
00:15:15,455 --> 00:15:16,223
2
399
00:15:16,479 --> 00:15:17,503
Simple Road
400
00:15:18,015 --> 00:15:20,575
So let's change holidays degrees then
401
00:15:20,831 --> 00:15:21,855
2 rotation
402
00:15:23,135 --> 00:15:25,439
So that's in radians equals angle
403
00:15:25,695 --> 00:15:30,047
Going to do rotation from our current rotation to
404
00:15:31,071 --> 00:15:34,143
Calling this target rotation degrees let's rename this bye
405
00:15:34,399 --> 00:15:36,191
Hi lighting and heating control
406
00:15:36,959 --> 00:15:37,471
Target
407
00:15:37,727 --> 00:15:38,751
Rotation
408
00:15:39,007 --> 00:15:41,055
So that will rename both the same time
409
00:15:41,311 --> 00:15:42,591
And then we'll get rid of this red
410
00:15:42,847 --> 00:15:43,615
2 dead
411
00:15:46,175 --> 00:15:47,967
And one stand put dead
412
00:15:48,223 --> 00:15:49,759
To ride around
413
00:15:50,271 --> 00:15:50,783
The nine
414
00:15:51,807 --> 00:15:52,831
So that we can get
415
00:15:53,087 --> 00:15:54,367
90 degrees in
416
00:15:55,135 --> 00:15:56,671
Alright let's see how the
417
00:15:59,231 --> 00:16:02,303
That's looking great I am really happy with Alex look
418
00:16:02,559 --> 00:16:06,655
I'm going to make one change in here and instead of doing x negative
419
00:16:06,911 --> 00:16:09,471
Get process all the time I'm going to do -2
420
00:16:09,727 --> 00:16:11,263
Times get prices delta time
421
00:16:11,519 --> 00:16:15,615
Just to make a girl a little bit faster in terms of the rotation
422
00:16:17,919 --> 00:16:19,967
Alright that's looking great so now we've got
423
00:16:20,223 --> 00:16:22,015
A good amount of Motion
424
00:16:22,271 --> 00:16:23,039
In our
425
00:16:23,551 --> 00:16:26,367
Are experienced violence and it's looking a lot better now
426
00:16:26,623 --> 00:16:28,415
And one final thing that we can do
427
00:16:28,671 --> 00:16:30,719
How to make this look a little bit better
428
00:16:30,975 --> 00:16:33,535
Is we can actually scale
429
00:16:33,791 --> 00:16:34,303
The
430
00:16:34,559 --> 00:16:38,655
Vials out so that it looks a little bit smooth like they're being collect
431
00:16:39,167 --> 00:16:43,263
We need to do that is let's go towards screen and let's do tween dot
432
00:16:43,519 --> 00:16:44,287
Set pair
433
00:16:44,799 --> 00:16:50,943
No a twin upset parallel does is a run all of the tweeners in parallel so this is one tweener right here
434
00:16:51,199 --> 00:16:52,223
We're going to create another one
435
00:16:52,735 --> 00:16:53,759
Which is tween
436
00:16:54,783 --> 00:16:55,295
Start
437
00:16:56,063 --> 00:16:56,831
Between property
438
00:16:57,343 --> 00:17:00,159
We're going to tween the property of the Sprite 2
439
00:17:00,671 --> 00:17:04,255
So let's go ahead and grabbing already reference to the Sprite 2D
440
00:17:04,511 --> 00:17:05,279
Bye
441
00:17:05,535 --> 00:17:09,887
Dragging this over into the editor and holding control to do on ready or you can type it out
442
00:17:10,143 --> 00:17:13,471
Do you prefer and I'm going to actually call this Sprite instead of Sky
443
00:17:13,727 --> 00:17:14,239
Today
444
00:17:15,007 --> 00:17:18,847
So back down to this line to win the dream property between sprite
445
00:17:19,103 --> 00:17:21,151
The property that we're going to tween is scale
446
00:17:21,663 --> 00:17:22,175
Enquire
447
00:17:22,687 --> 00:17:27,551
So if you're unfamiliar with what the property is called you can just scroll down into the
448
00:17:27,807 --> 00:17:28,575
Editor here
449
00:17:28,831 --> 00:17:32,671
Scroll down to transform if you have her over it it will tell you what the property
450
00:17:33,439 --> 00:17:34,207
Flat scale
451
00:17:34,719 --> 00:17:37,023
And then we're going to say we were
452
00:17:37,535 --> 00:17:40,607
Transition to Vector 2.0 this is our final
453
00:17:40,863 --> 00:17:41,631
Value here
454
00:17:41,887 --> 00:17:45,215
And we wanted to be a duration of let's 8.1
455
00:17:46,495 --> 00:17:47,775
Now the problem here
456
00:17:48,031 --> 00:17:52,127
Is that when we have set parallel both of these are going to run at the same time
457
00:17:52,639 --> 00:17:54,687
And so is this tween callback
458
00:17:54,943 --> 00:17:55,967
Which is that what we are
459
00:17:56,479 --> 00:17:59,295
So they fix the twin call back being called too early
460
00:17:59,551 --> 00:18:00,063
We can
461
00:18:00,319 --> 00:18:02,111
Do tween dart charge
462
00:18:02,623 --> 00:18:04,671
You might win that changed as it says
463
00:18:04,927 --> 00:18:07,487
Wait for all of the previous twins
464
00:18:07,743 --> 00:18:08,511
To finish
465
00:18:08,767 --> 00:18:10,303
Before moving on to the next
466
00:18:11,071 --> 00:18:11,583
So
467
00:18:11,839 --> 00:18:14,143
Now or collect only be called when both of these
468
00:18:14,655 --> 00:18:17,471
Are we still the problem of this point one 5 seconds
469
00:18:17,727 --> 00:18:20,543
Is quicker than a .5 seconds we have a pier
470
00:18:20,799 --> 00:18:22,591
And because these are running in parallel
471
00:18:22,847 --> 00:18:27,199
That means that between out before it has a chance to do any of this animation
472
00:18:27,711 --> 00:18:31,551
And so what we're going to do is I'm going to set a delay here so I'm going to say sorry
473
00:18:31,807 --> 00:18:33,343
Underscore delay
474
00:18:33,599 --> 00:18:36,159
Animal set a delayed 2.35
475
00:18:36,671 --> 00:18:37,951
And so this is going to say why
476
00:18:38,207 --> 00:18:41,535
.35 seconds before you animated thing
477
00:18:41,791 --> 00:18:44,095
And take a .15 seconds to do it
478
00:18:44,351 --> 00:18:48,447
And that what had up to be .5 seconds total which is the same value as
479
00:18:48,959 --> 00:18:53,567
Let's go ahead and Run the game and make sure that this is working as we expect
480
00:18:53,823 --> 00:18:55,103
Now the vile should be
481
00:18:55,359 --> 00:18:56,127
Feeding
482
00:18:56,383 --> 00:18:57,151
Nothing
483
00:18:58,175 --> 00:19:01,503
And if that's a little bit too quick of a fade out for you
484
00:19:01,759 --> 00:19:04,831
I think it is for me I might see if I can get away with
485
00:19:05,087 --> 00:19:07,647
5 for the scale duration
486
00:19:07,903 --> 00:19:08,671
And then changes
487
00:19:08,927 --> 00:19:10,207
2.45 delay
488
00:19:14,047 --> 00:19:17,631
Alright it's very subtle but sometimes salty Is All You Need
489
00:19:18,143 --> 00:19:19,423
I really like that look
490
00:19:20,703 --> 00:19:22,239
It doesn't abruptly
491
00:19:22,495 --> 00:19:27,103
Leave existence anymore you can see a few frames of it actually sliding out
492
00:19:27,615 --> 00:19:30,943
You can't looks like it's going to the players inventory so I think that looks real
493
00:19:31,455 --> 00:19:36,831
Ok so that was a long lesson but that is a good introduction to tweens and how powerful they are
494
00:19:37,087 --> 00:19:39,647
It's a nice way of ending things in code
495
00:19:39,903 --> 00:19:41,951
And like I said doing things
496
00:19:42,207 --> 00:19:45,023
In a way where you might have variable
497
00:19:46,047 --> 00:19:46,559
Think about
498
00:19:46,815 --> 00:19:50,143
Doing this with an animation player how would you make a vile
499
00:19:50,399 --> 00:19:53,983
Travel toward the player pointing in the direction of the player
500
00:19:54,239 --> 00:19:58,847
If you want using a tweet that would be almost impossible if not outright impossible to a comp
501
00:19:59,103 --> 00:20:00,639
With a plain old animation player
502
00:20:00,895 --> 00:20:02,687
This is where Queen's really sure
503
00:20:03,199 --> 00:20:06,783
And before I conclude the lesson that's on comment out
504
00:20:07,039 --> 00:20:08,319
Game event starting
505
00:20:08,575 --> 00:20:12,671
Experienced vinyl collected and a let's go back to our basic enemy
506
00:20:12,927 --> 00:20:16,511
Add make sure you put the strap percent in the Vial dropped and
507
00:20:17,023 --> 00:20:17,791
Back down
508
00:20:18,047 --> 00:20:18,815
835
509
00:20:19,071 --> 00:20:20,607
Or whatever number you feel country
510
00:20:21,631 --> 00:20:24,447
And let's do a quick verification that we can still
511
00:20:24,703 --> 00:20:25,215
Level
512
00:20:27,519 --> 00:20:29,311
Hi perfect everything is working
513
00:20:29,567 --> 00:20:31,615
And that's it for vile
514
00:20:31,871 --> 00:20:32,639
Pick up animation
34630
Can't find what you're looking for?
Get subtitles in any language from opensubtitles.com, and translate them here.