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:02,048
Let's Create another ability
2
00:00:02,304 --> 00:00:05,376
For the player so that we have a little bit more gameplay for riot
3
00:00:05,888 --> 00:00:10,240
So just as a refresher let's go ahead and open up our sword ability
4
00:00:10,496 --> 00:00:11,264
Control
5
00:00:11,776 --> 00:00:14,592
By hitting ctrl shift on a keyboard and searching for it
6
00:00:14,848 --> 00:00:18,176
And our ability controller consists of
7
00:00:18,432 --> 00:00:18,944
A timer
8
00:00:19,456 --> 00:00:20,736
A root note
9
00:00:20,992 --> 00:00:23,296
We're pretty much going to model our new ability
10
00:00:23,552 --> 00:00:24,576
After this
11
00:00:24,832 --> 00:00:25,856
In the same way
12
00:00:26,112 --> 00:00:27,136
We can open up the
13
00:00:27,648 --> 00:00:29,440
I just take a look at what's going on here
14
00:00:29,696 --> 00:00:30,464
We're going to do
15
00:00:30,720 --> 00:00:32,768
Very similar things to what's going on in there
16
00:00:33,024 --> 00:00:34,304
Sword ability controller
17
00:00:34,560 --> 00:00:37,632
However one interesting challenge that we're going to have to do
18
00:00:37,888 --> 00:00:42,240
Is figure out how to allow the player to choose the ability
19
00:00:42,496 --> 00:00:43,776
As a reward
20
00:00:44,032 --> 00:00:45,312
For levelling up
21
00:00:45,568 --> 00:00:46,336
But that will be
22
00:00:46,592 --> 00:00:50,176
Tangled in a little lesson which is focus on actually making
23
00:00:50,432 --> 00:00:50,944
Ability
24
00:00:51,200 --> 00:00:52,224
First solar
25
00:00:52,480 --> 00:00:54,528
Click on the scene window
26
00:00:54,784 --> 00:00:56,832
Mahir and then hit control and on the keyboard
27
00:00:57,088 --> 00:00:57,856
How to create a new scene
28
00:00:58,112 --> 00:01:00,141
Let's select other node in
29
00:01:00,143 --> 00:01:02,491
Subtitled by
online-courses.club
We compress knowledge for you!
30
00:01:02,492 --> 00:01:01,696
Route type of no
31
00:01:01,952 --> 00:01:02,464
The top here
32
00:01:02,720 --> 00:01:04,256
And let's call this
33
00:01:04,768 --> 00:01:05,280
X
34
00:01:05,536 --> 00:01:06,304
Ability
35
00:01:08,352 --> 00:01:09,120
Controller
36
00:01:10,400 --> 00:01:11,424
Read and say that
37
00:01:11,936 --> 00:01:12,960
2 Singh's
38
00:01:13,216 --> 00:01:13,728
Ability
39
00:01:13,984 --> 00:01:17,312
We have the sword ability in sword ability controller with screen new folder
40
00:01:17,568 --> 00:01:18,080
Ask
41
00:01:19,616 --> 00:01:20,384
Controller
42
00:01:22,432 --> 00:01:26,016
So is created at folder in the ability directory and then we can just say
43
00:01:26,272 --> 00:01:27,040
Write in there
44
00:01:28,320 --> 00:01:29,088
Loudest
45
00:01:29,344 --> 00:01:33,440
Script area is getting a little bit closer hear some going to right click anywhere in
46
00:01:33,696 --> 00:01:34,720
A script here
47
00:01:34,976 --> 00:01:36,256
I'm just going to say clothes
48
00:01:37,024 --> 00:01:38,048
I will clean it up nicely
49
00:01:38,304 --> 00:01:40,096
I'm going to go in at a
50
00:01:40,352 --> 00:01:41,376
Script to the sack
51
00:01:41,888 --> 00:01:42,400
Lee controller
52
00:01:43,936 --> 00:01:45,984
You should be ok so
53
00:01:46,240 --> 00:01:46,752
Create
54
00:01:47,008 --> 00:01:49,312
Now before we write anything in r script
55
00:01:49,568 --> 00:01:51,616
Let's add a timer
56
00:01:51,872 --> 00:01:53,920
So we're going to add a child no timer
57
00:01:54,176 --> 00:01:59,552
And pick a time that you think is reasonable for the accessibility I'm going to 2 seconds
58
00:01:59,808 --> 00:02:03,392
I know I haven't describe what the accident is going to be yet but let's just get this
59
00:02:03,904 --> 00:02:06,464
So I did 2 seconds and then I'll start
60
00:02:07,744 --> 00:02:08,256
Ok
61
00:02:08,512 --> 00:02:14,656
So before you go any further what I want to do with the accessibility is I'm going to go to the tile maps of the ca
62
00:02:14,912 --> 00:02:15,680
Any tiny dungeon
63
00:02:15,936 --> 00:02:17,728
I'm going to open up the tire on my part
64
00:02:17,984 --> 00:02:19,520
And I want to take this
65
00:02:19,776 --> 00:02:22,336
X right here this this
66
00:02:22,848 --> 00:02:24,896
And what I want to do with this as I want
67
00:02:25,152 --> 00:02:26,432
To spawn at the
68
00:02:26,688 --> 00:02:30,528
Disposition and then spiral outward gradually in a radius
69
00:02:30,784 --> 00:02:32,320
Damaging every enemy
70
00:02:32,576 --> 00:02:33,088
Hits
71
00:02:33,344 --> 00:02:37,952
I think it's going to be really fun ability to make and it shouldn't be too complicated
72
00:02:38,208 --> 00:02:41,792
I'm actually going to go look for this acts image now
73
00:02:42,304 --> 00:02:43,328
So I'm going to go
74
00:02:43,584 --> 00:02:44,096
2
75
00:02:44,352 --> 00:02:45,888
The tiles directory
76
00:02:46,144 --> 00:02:47,680
Of that asset pack
77
00:02:47,936 --> 00:02:49,728
And I'm just going to scroll Intel i5
78
00:02:49,984 --> 00:02:51,776
Dial 011
79
00:02:52,288 --> 00:02:54,592
I'm just going to drive it over into the editor
80
00:02:54,848 --> 00:02:57,664
Into the file system dark and then should place it
81
00:02:57,920 --> 00:03:00,736
And then I'm going to go open up my seems ability
82
00:03:00,992 --> 00:03:03,552
Let's create a new folder under the
83
00:03:03,808 --> 00:03:05,856
The ability directory in C
84
00:03:06,368 --> 00:03:07,136
So in a create
85
00:03:07,392 --> 00:03:07,904
A
86
00:03:08,160 --> 00:03:09,184
New folder
87
00:03:09,440 --> 00:03:12,768
And I'm going to call this x underscore ability
88
00:03:14,304 --> 00:03:16,096
Emery name this tile
89
00:03:16,608 --> 00:03:17,120
2
90
00:03:18,400 --> 00:03:18,912
Axe
91
00:03:19,424 --> 00:03:23,264
And then I'm going to distract that acts over into the accessibility directory
92
00:03:25,824 --> 00:03:28,384
How many create another scene by hidden control
93
00:03:28,640 --> 00:03:31,456
The keyboard that's making a root type of 2D scene
94
00:03:31,712 --> 00:03:34,272
Let's call this axe ability
95
00:03:34,784 --> 00:03:40,160
Let's save it let's go up a couple of directories until we find that accessibility folder
96
00:03:40,416 --> 00:03:40,928
Created
97
00:03:41,184 --> 00:03:41,696
Click into
98
00:03:42,208 --> 00:03:42,720
And saved
99
00:03:42,976 --> 00:03:43,488
In there
100
00:03:44,256 --> 00:03:48,096
Is it control a 2 add a new note search for types bright 2
101
00:03:48,352 --> 00:03:49,120
Add
102
00:03:50,144 --> 00:03:51,424
And then drag over that
103
00:03:51,680 --> 00:03:52,960
Text png onto the
104
00:03:53,216 --> 00:03:53,728
Your property
105
00:03:53,984 --> 00:03:57,312
Let's like a 2D button at the top so we can go back or to leave
106
00:03:57,568 --> 00:04:01,408
This is what I actually looks like and I think the default settings here are pretty much
107
00:04:02,176 --> 00:04:02,944
Fine
108
00:04:03,200 --> 00:04:03,712
They are
109
00:04:03,968 --> 00:04:06,016
And will do more of this accessibility later
110
00:04:06,272 --> 00:04:12,416
All I want to do is I want to make the accessibility controller spawn the axe so let's go to our x
111
00:04:12,672 --> 00:04:14,464
Body control seen open up that's cool
112
00:04:14,976 --> 00:04:21,119
Let's do export in you probably know where we're going we're going to export that scene so I can say
113
00:04:21,375 --> 00:04:22,655
RX ability
114
00:04:23,167 --> 00:04:23,679
Scene
115
00:04:23,935 --> 00:04:24,703
Of time
116
00:04:24,959 --> 00:04:25,727
Packed scene
117
00:04:25,983 --> 00:04:32,127
Before we go any further let's just go out and drag that accessibility seen over in here so go to your file system
118
00:04:32,383 --> 00:04:34,175
The accessibility and Dragon all over
119
00:04:34,431 --> 00:04:36,479
Of course you can use the load
120
00:04:36,735 --> 00:04:39,807
Dialogue here in selected manually from the file system
121
00:04:40,063 --> 00:04:40,831
If you prefer
122
00:04:41,855 --> 00:04:47,999
So let's override the ready method here let's grab a reference to the timer with dollar sign
123
00:04:48,767 --> 00:04:50,303
And then we're going to say
124
00:04:50,559 --> 00:04:51,327
Time out
125
00:04:51,583 --> 00:04:52,095
Connect
126
00:04:52,607 --> 00:04:54,143
On timer timer
127
00:04:54,399 --> 00:04:58,239
And again I'm going to get a little bit faster with the scripting now because we've
128
00:04:58,495 --> 00:05:00,287
Done a lot of the stuff already
129
00:05:00,543 --> 00:05:02,335
So Funk on timer
130
00:05:02,591 --> 00:05:03,103
Time out
131
00:05:04,127 --> 00:05:05,407
And let's
132
00:05:05,663 --> 00:05:08,223
Create an instance of that accessibility
133
00:05:08,735 --> 00:05:10,527
So we're going to save our
134
00:05:11,039 --> 00:05:15,135
Instance is equal to accessibility scene.in stands
135
00:05:15,647 --> 00:05:17,695
And we can say as no 2D because
136
00:05:17,951 --> 00:05:18,975
The type that is
137
00:05:19,231 --> 00:05:20,255
And what we wanted
138
00:05:20,511 --> 00:05:22,559
Well we want to grab a reference to the play
139
00:05:22,815 --> 00:05:27,423
So let's go and do that bar Playa is equal to get underscore 3
140
00:05:27,935 --> 00:05:30,751
Get first node in group in quotes player
141
00:05:31,007 --> 00:05:31,519
Asthma
142
00:05:31,775 --> 00:05:34,847
And then let's do a check if player is he
143
00:05:35,871 --> 00:05:36,383
Let's
144
00:05:36,639 --> 00:05:37,663
Return out of that
145
00:05:37,919 --> 00:05:38,431
Perfect
146
00:05:38,943 --> 00:05:43,039
Let's grab a reference to the foreground so we're going to save our foreground
147
00:05:43,551 --> 00:05:44,319
Is it going to get
148
00:05:44,575 --> 00:05:46,367
Tree get first
149
00:05:46,623 --> 00:05:47,903
Group
150
00:05:48,415 --> 00:05:49,439
As known to
151
00:05:49,951 --> 00:05:52,767
Remember our foreground is in our main seen here
152
00:05:53,023 --> 00:05:54,303
It's this note to die
153
00:05:54,559 --> 00:05:58,655
And it has the group for Grant lair so we actually need to
154
00:05:58,911 --> 00:06:00,191
Update the string
155
00:06:00,447 --> 00:06:02,495
Sonar accessibility controller screw
156
00:06:02,751 --> 00:06:03,775
This needs to be
157
00:06:04,031 --> 00:06:05,823
Foreground underscore letter here
158
00:06:06,079 --> 00:06:07,103
That's going to give us
159
00:06:07,359 --> 00:06:08,383
Basically where out
160
00:06:08,639 --> 00:06:10,431
Abilities will exist as chilled
161
00:06:10,943 --> 00:06:11,967
Can we can
162
00:06:12,223 --> 00:06:16,831
Also add a safety check here if we want to solve will say if for ground
163
00:06:17,087 --> 00:06:17,599
No
164
00:06:18,111 --> 00:06:18,623
Send
165
00:06:18,879 --> 00:06:20,415
Return out of that as well
166
00:06:21,183 --> 00:06:23,231
Ok so then we got her x instance
167
00:06:23,487 --> 00:06:26,303
Let's save foreground add child
168
00:06:26,559 --> 00:06:27,071
X
169
00:06:27,327 --> 00:06:28,095
Instance
170
00:06:28,351 --> 00:06:29,887
And then we're going to say
171
00:06:30,911 --> 00:06:31,679
Instant
172
00:06:31,935 --> 00:06:34,495
Global position is equal to
173
00:06:35,007 --> 00:06:36,799
Claire glow up
174
00:06:38,335 --> 00:06:40,383
Ok let's hit ctrl shift o
175
00:06:40,639 --> 00:06:41,919
And then open up our
176
00:06:42,175 --> 00:06:42,687
Players
177
00:06:44,223 --> 00:06:50,111
In our building manager let's instantiate a child scene and put the accessibility controller
178
00:06:50,367 --> 00:06:51,647
Right next to
179
00:06:52,159 --> 00:06:55,231
The sword ability controller so again right click ability manager
180
00:06:55,487 --> 00:06:57,023
Instantiate child scene
181
00:06:57,279 --> 00:06:58,559
And access
182
00:06:58,815 --> 00:06:59,327
Comptroller in there
183
00:06:59,839 --> 00:07:02,143
If we did everything right when we play the game
184
00:07:02,399 --> 00:07:03,423
We should see
185
00:07:03,935 --> 00:07:04,447
Daddy
186
00:07:04,703 --> 00:07:07,007
Periodically spawns at the player position there
187
00:07:08,543 --> 00:07:10,335
Now I need my tax actually work
188
00:07:10,591 --> 00:07:12,639
Lorax ability scene
189
00:07:12,895 --> 00:07:14,687
We can go back to the TV mode Justice
190
00:07:15,199 --> 00:07:16,479
Just to see what's going on here
191
00:07:16,735 --> 00:07:19,039
And let's go data script and the diff
192
00:07:19,295 --> 00:07:20,319
Location is good
193
00:07:20,831 --> 00:07:24,671
So whatever you want to do in the accessibility well the first thing that we were
194
00:07:24,927 --> 00:07:26,975
Do is we probably want
195
00:07:27,231 --> 00:07:27,999
2
196
00:07:28,255 --> 00:07:29,023
Animator
197
00:07:29,279 --> 00:07:33,119
And again I wanted to Spiral out away from the player
198
00:07:33,375 --> 00:07:36,447
I think the easiest way to do that is going to be using a
199
00:07:36,703 --> 00:07:37,215
Between
200
00:07:37,471 --> 00:07:39,519
Override the ready method
201
00:07:41,311 --> 00:07:45,151
I'm going to do is really creative tweens of our tween is equal to create
202
00:07:45,663 --> 00:07:47,711
Now Queens are in you can't
203
00:07:47,967 --> 00:07:48,479
For us
204
00:07:48,735 --> 00:07:54,879
A tween is essentially a way of programmatically defining animations we can animate pretty much any
205
00:07:55,135 --> 00:07:55,903
Property in the same way
206
00:07:56,159 --> 00:07:57,439
We can in animation player
207
00:07:57,695 --> 00:08:01,023
But Queens are a little bit more flexible in some case
208
00:08:01,279 --> 00:08:02,047
Animation player
209
00:08:02,303 --> 00:08:04,863
Because we can pass in variable
210
00:08:05,119 --> 00:08:05,631
Property
211
00:08:05,887 --> 00:08:08,191
So if you're a car with an animation player we
212
00:08:08,447 --> 00:08:10,239
Define specific keyframes
213
00:08:10,495 --> 00:08:11,263
Alarm
214
00:08:11,519 --> 00:08:12,799
The animation
215
00:08:13,055 --> 00:08:13,823
And
216
00:08:14,079 --> 00:08:14,847
With a tween
217
00:08:15,103 --> 00:08:16,895
If we have some variable
218
00:08:17,151 --> 00:08:18,943
Like we want to move
219
00:08:19,199 --> 00:08:20,479
Or anime something
220
00:08:20,735 --> 00:08:22,015
Between two positions
221
00:08:22,271 --> 00:08:24,575
Does positions vary then we can easily accomplish
222
00:08:25,343 --> 00:08:26,879
So this case what we gonna do
223
00:08:27,391 --> 00:08:28,415
Is we are going to
224
00:08:28,671 --> 00:08:29,183
Between
225
00:08:29,439 --> 00:08:29,951
The position
226
00:08:30,207 --> 00:08:32,255
Of the acts over time
227
00:08:33,535 --> 00:08:34,047
Spiral
228
00:08:34,303 --> 00:08:35,583
So it's going to be a little bit
229
00:08:36,095 --> 00:08:37,887
Tricky but I'm going to do the best that I
230
00:08:38,399 --> 00:08:38,911
Describe what
231
00:08:39,679 --> 00:08:41,983
What I want to do is I want to call tween dot
232
00:08:42,239 --> 00:08:43,007
Screen
233
00:08:44,543 --> 00:08:48,639
And essentially what this has to do is this allows us to call and message
234
00:08:48,895 --> 00:08:50,943
Where we can write our own behave
235
00:08:51,199 --> 00:08:52,991
This is not typically how you do
236
00:08:53,247 --> 00:08:54,527
Between button Arcade
237
00:08:54,783 --> 00:08:55,551
This is what we
238
00:08:56,319 --> 00:08:57,855
So the method it takes a cold
239
00:08:58,111 --> 00:08:58,879
So we'll see
240
00:08:59,391 --> 00:09:01,695
Tween underscore method which Wills
241
00:09:01,951 --> 00:09:02,463
Soon
242
00:09:02,719 --> 00:09:04,511
What do we want to win it from well
243
00:09:04,767 --> 00:09:08,095
H from value at R2 value is going to rappers
244
00:09:08,607 --> 00:09:10,143
What's a revolution
245
00:09:10,655 --> 00:09:11,935
So let's say that we want
246
00:09:12,191 --> 00:09:12,703
To do
247
00:09:13,215 --> 00:09:13,983
To Revel
248
00:09:14,239 --> 00:09:15,519
So we're going to have it going
249
00:09:15,775 --> 00:09:16,287
Twice
250
00:09:16,543 --> 00:09:18,847
I'm going to say 0 for the fur
251
00:09:19,359 --> 00:09:19,871
Valley
252
00:09:20,127 --> 00:09:21,407
And 2 for the second
253
00:09:21,919 --> 00:09:23,711
And duration can be
254
00:09:23,967 --> 00:09:27,039
Whatever you think is reasonable I think I'm going to use too
255
00:09:27,295 --> 00:09:27,807
Since
256
00:09:28,063 --> 00:09:29,087
The delay
257
00:09:30,623 --> 00:09:32,159
Always have an axe
258
00:09:33,951 --> 00:09:35,487
Let's define that method
259
00:09:35,743 --> 00:09:36,255
Tween
260
00:09:39,839 --> 00:09:43,679
And there's going to be an argument that comes into a method and that is going to be
261
00:09:43,935 --> 00:09:45,727
Whatever the current value is
262
00:09:45,983 --> 00:09:47,263
Between the from and to
263
00:09:47,519 --> 00:09:50,847
So this twin is going to basically interpret
264
00:09:51,103 --> 00:09:52,127
Between 0 and 2
265
00:09:52,383 --> 00:09:53,407
Over 2
266
00:09:54,175 --> 00:09:55,711
And then in our method we can
267
00:09:55,967 --> 00:09:58,527
We can get that value so we're going to say
268
00:09:58,783 --> 00:09:59,807
Rotations
269
00:10:00,345 --> 00:10:02,632
Subtitled by
online-courses.club
We compress knowledge for you!
270
00:10:02,634 --> 00:10:01,599
In this
271
00:10:01,855 --> 00:10:02,879
Float
272
00:10:03,135 --> 00:10:04,415
So that's right passing
273
00:10:04,927 --> 00:10:08,511
So I want these to rotate around the player but I also want the radio
274
00:10:08,767 --> 00:10:10,559
To grow as it rotates around
275
00:10:11,327 --> 00:10:12,351
And so let's
276
00:10:12,607 --> 00:10:14,399
Create a constant of here
277
00:10:14,911 --> 00:10:16,447
Call Max radius
278
00:10:16,959 --> 00:10:19,007
Just said it to 102
279
00:10:19,775 --> 00:10:21,567
Ok so back in the Twin method
280
00:10:21,823 --> 00:10:24,127
Well I'm going to say I'm going to save our current radius
281
00:10:26,431 --> 00:10:27,455
Is equal to
282
00:10:28,735 --> 00:10:29,759
Rotation
283
00:10:30,015 --> 00:10:31,039
/ 2
284
00:10:31,295 --> 00:10:33,343
What put that in parentheses by highlighting it
285
00:10:33,599 --> 00:10:34,111
And here
286
00:10:34,367 --> 00:10:35,647
They opened Francis
287
00:10:35,903 --> 00:10:38,207
And then again and multiply that by our Max
288
00:10:38,719 --> 00:10:40,511
So we're doing here for essentially saying
289
00:10:40,767 --> 00:10:42,559
Well 2 is our Max about
290
00:10:43,071 --> 00:10:44,607
And so this is going to be
291
00:10:44,863 --> 00:10:46,655
Percentage and pull that into another
292
00:10:46,911 --> 00:10:48,959
Variable 3% is equal to
293
00:10:49,471 --> 00:10:51,007
Rotations / 2
294
00:10:51,263 --> 00:10:52,031
And then we can
295
00:10:52,287 --> 00:10:53,055
Replace that
296
00:10:53,311 --> 00:10:54,079
With person
297
00:10:54,591 --> 00:10:58,175
So that's going to be how far along in the radius we are
298
00:10:58,431 --> 00:11:00,223
And then our current angle
299
00:11:00,735 --> 00:11:01,759
Is going to be
300
00:11:02,015 --> 00:11:02,783
Applied
301
00:11:03,039 --> 00:11:03,807
To a Vet
302
00:11:04,063 --> 00:11:06,367
So Let's save our current Direction
303
00:11:07,135 --> 00:11:07,903
Is it
304
00:11:08,159 --> 00:11:11,487
2 letters use the constant vector to write
305
00:11:11,743 --> 00:11:13,023
Are we going to rotate
306
00:11:13,279 --> 00:11:14,815
And what are we going to rotate it by
307
00:11:15,071 --> 00:11:16,607
We're going to rotated by
308
00:11:16,863 --> 00:11:18,143
Rotations
309
00:11:18,399 --> 00:11:19,167
X
310
00:11:19,679 --> 00:11:20,191
Tau
311
00:11:20,959 --> 00:11:22,495
So does this make sense so
312
00:11:22,751 --> 00:11:27,871
From 01 will be less than 360 degrees remember Towers to pie and this isn't radius
313
00:11:28,895 --> 00:11:31,199
As we exceed one it would just wrap around
314
00:11:31,455 --> 00:11:34,015
What in an asthma approach to that will be to Revell
315
00:11:34,271 --> 00:11:35,551
We could use a
316
00:11:35,807 --> 00:11:40,415
You know we can rotate this by our current rotation which is going to be in there between 0 and 2
317
00:11:40,671 --> 00:11:42,207
X x
318
00:11:42,719 --> 00:11:43,743
What are proper rotation
319
00:11:45,023 --> 00:11:47,327
So now we need to set the global position on the app
320
00:11:47,839 --> 00:11:49,887
And what we're going to do as we're going to save our
321
00:11:51,167 --> 00:11:54,751
What's happened to the players of our player is equal to get 3
322
00:11:56,031 --> 00:11:57,055
Snowden
323
00:11:57,567 --> 00:11:58,847
Claire and
324
00:11:59,103 --> 00:12:03,199
Let's Create another variable above the player called via root position
325
00:12:03,455 --> 00:12:06,015
How much is initialise it to Vectra 2.0
326
00:12:07,295 --> 00:12:09,855
Underneath player with site if player
327
00:12:10,111 --> 00:12:11,391
Is equal to null
328
00:12:11,903 --> 00:12:17,023
Then we're just going to set root position is equal to our own global position of the app
329
00:12:17,535 --> 00:12:21,119
Otherwise if the player is not null we're going to say root position
330
00:12:21,375 --> 00:12:22,143
Is it good to
331
00:12:22,399 --> 00:12:22,911
Claire
332
00:12:23,167 --> 00:12:24,447
Dot global position
333
00:12:26,495 --> 00:12:27,007
Ok
334
00:12:27,263 --> 00:12:33,407
And then what we can do is we'll set the final global position of the axis also global position
335
00:12:33,919 --> 00:12:35,967
Is equal to root position
336
00:12:36,479 --> 00:12:38,015
Plus and this is going to look for Millie
337
00:12:38,527 --> 00:12:40,319
I'm going to take that current Direction
338
00:12:41,343 --> 00:12:42,879
Shannon x
339
00:12:43,391 --> 00:12:44,927
Buy the current radio
340
00:12:46,975 --> 00:12:52,863
Everything works what essential we should see is a rotation of the axe so let's go around the game
341
00:12:53,375 --> 00:12:53,887
See what happens
342
00:12:56,959 --> 00:13:01,055
So the acts is not rotating as we expect and you can see that is actually being really
343
00:13:01,311 --> 00:13:01,823
Digikey
344
00:13:03,103 --> 00:13:04,639
I think the reason for that is
345
00:13:04,895 --> 00:13:06,943
Between things that worth winning between
346
00:13:07,199 --> 00:13:07,967
Integers
347
00:13:08,223 --> 00:13:11,551
So it's only passing integer values into this rotations
348
00:13:11,807 --> 00:13:12,831
Twin method
349
00:13:13,087 --> 00:13:16,927
And the way that we can sort that was we can just tell a girl that this is actually a
350
00:13:17,183 --> 00:13:17,695
World
351
00:13:17,951 --> 00:13:19,487
By doing .0
352
00:13:19,999 --> 00:13:20,511
Source
353
00:13:21,023 --> 00:13:23,839
0.0 2.0 that would tell us that this is a float
354
00:13:24,095 --> 00:13:25,119
And let's see it
355
00:13:26,143 --> 00:13:27,167
Ok so like that
356
00:13:27,423 --> 00:13:29,983
We're going to ask that gradually increases
357
00:13:30,239 --> 00:13:32,031
In radius and swings around
358
00:13:32,543 --> 00:13:34,591
Galleries going little bit fat
359
00:13:35,103 --> 00:13:36,895
So I'm going to probably turn this down
360
00:13:37,663 --> 00:13:39,967
3 seconds instead and see how that look
361
00:13:44,319 --> 00:13:47,647
Perfect ok so let's go over this logic again just to be really clear
362
00:13:48,415 --> 00:13:51,231
So we're defining a mackerel yes that's as far
363
00:13:51,487 --> 00:13:53,023
The axe can be away from the
364
00:13:54,559 --> 00:14:00,191
That were sitting at between were telling between that we want to go between a value of 0 and 2
365
00:14:00,447 --> 00:14:01,471
Over 3 seconds
366
00:14:01,727 --> 00:14:03,263
And while your tween
367
00:14:03,519 --> 00:14:04,287
Call this
368
00:14:04,543 --> 00:14:05,823
This twin method
369
00:14:06,079 --> 00:14:07,871
With whatever interpolated
370
00:14:08,639 --> 00:14:10,431
This value represents our rotation
371
00:14:10,687 --> 00:14:11,967
Define between
372
00:14:12,223 --> 00:14:15,551
The functions were taking in the number of rotations that have happened
373
00:14:15,807 --> 00:14:17,343
And it could be a fractional number
374
00:14:17,599 --> 00:14:20,671
We're just going to get the percentage value in order to calculate
375
00:14:20,927 --> 00:14:25,791
What our radius should be so this will be anywhere between 0 and 100
376
00:14:26,047 --> 00:14:27,327
As were multiplying in here
377
00:14:28,095 --> 00:14:31,679
And then our Direction we're gonna take the number of rotations that we are
378
00:14:31,935 --> 00:14:32,959
Multiply that
379
00:14:33,215 --> 00:14:33,727
A towel
380
00:14:33,983 --> 00:14:35,775
And use that as a rotation
381
00:14:36,031 --> 00:14:37,055
Applied to
382
00:14:37,567 --> 00:14:38,591
The right vector
383
00:14:38,847 --> 00:14:41,663
And again the right vector is at 0 degrees or 0
384
00:14:42,431 --> 00:14:44,223
Direction of the unit vector
385
00:14:44,479 --> 00:14:45,503
We got a trade
386
00:14:46,015 --> 00:14:49,343
And all the rest of this is essentially just figuring out how to position the app
387
00:14:49,855 --> 00:14:54,463
So we're getting a root position in the root position is either going to be the player if it is
388
00:14:54,975 --> 00:14:55,999
So on this line
389
00:14:56,511 --> 00:14:59,583
Or we're just going to use the current global position of the
390
00:14:59,839 --> 00:15:00,351
As
391
00:15:01,887 --> 00:15:04,703
Not occur to me that this is actually probably going to break
392
00:15:04,959 --> 00:15:05,983
It's a pleasure is
393
00:15:07,007 --> 00:15:11,103
So I think we probably actually be better off removing this line and then just writing
394
00:15:11,359 --> 00:15:12,383
Return in store
395
00:15:12,895 --> 00:15:15,199
And then we can remove the else and on it
396
00:15:15,967 --> 00:15:18,783
So make sure on intent that's very important otherwise
397
00:15:19,295 --> 00:15:20,575
It will not be afraid
398
00:15:21,087 --> 00:15:21,855
Ok so
399
00:15:22,111 --> 00:15:25,695
Exist would just stop moving the X that's a simple Morrissey
400
00:15:25,951 --> 00:15:29,791
But if it does exist within a set a route position to the player global position
401
00:15:30,047 --> 00:15:34,399
And we can actually further simplify this so I'm going to actually just remove the root position out right
402
00:15:35,679 --> 00:15:36,959
Delete this line
403
00:15:37,471 --> 00:15:39,263
And then replace this route
404
00:15:39,519 --> 00:15:40,031
Play Adele
405
00:15:40,287 --> 00:15:40,799
What position
406
00:15:44,127 --> 00:15:48,479
Actually saying the axe is going to be rotating around the player global position
407
00:15:48,735 --> 00:15:50,527
And then we're going to offer
408
00:15:51,039 --> 00:15:52,063
From that position
409
00:15:52,319 --> 00:15:54,623
By the current Direction we calculate the time
410
00:15:55,647 --> 00:15:57,439
So when we do saw we end
411
00:15:57,695 --> 00:15:58,975
Something like
412
00:15:59,487 --> 00:16:03,327
Now we're still had done but this is the behaviour that we've got going on
413
00:16:03,583 --> 00:16:04,351
Ennis looking
414
00:16:04,863 --> 00:16:05,631
So what's
415
00:16:05,887 --> 00:16:10,495
So twins are really useful because we can actually tell it to queue up a function call
416
00:16:10,751 --> 00:16:11,519
After
417
00:16:11,775 --> 00:16:14,591
It finishes tweening a previous them so I can
418
00:16:14,847 --> 00:16:16,127
In my ready made that I can
419
00:16:16,383 --> 00:16:16,895
Between
420
00:16:17,151 --> 00:16:18,431
Tween callback
421
00:16:18,687 --> 00:16:20,479
And then I can write in here queue
422
00:16:21,247 --> 00:16:22,271
Now again
423
00:16:22,527 --> 00:16:24,575
Do not invoke this by doing
424
00:16:24,831 --> 00:16:25,855
This that
425
00:16:26,623 --> 00:16:29,183
You need to just passing a reference to let me
426
00:16:29,439 --> 00:16:31,487
I just using the name without involving a
427
00:16:31,999 --> 00:16:33,535
What is it going to do is this is go
428
00:16:33,791 --> 00:16:34,303
Two twin
429
00:16:34,559 --> 00:16:38,655
Between 0 and 2/3 seconds and then when the tween is done it will free
430
00:16:38,911 --> 00:16:39,935
The apps for us
431
00:16:40,447 --> 00:16:42,495
Get me to run again just to make sure that's going to work
432
00:16:42,751 --> 00:16:44,799
And your actions should be disappearing
433
00:16:47,359 --> 00:16:48,127
Alright xx
434
00:16:48,383 --> 00:16:50,687
So we have some more work to do to get this
435
00:16:50,943 --> 00:16:51,967
To actually work
436
00:16:52,223 --> 00:16:57,599
So if I open up my sword ability we can see that we've got a couple of things in here
437
00:16:58,111 --> 00:17:02,975
That we're going to need for the axe one of the things is the hitbox component so that he boxed
438
00:17:03,231 --> 00:17:06,303
Is very important to be able to damage enemies
439
00:17:06,559 --> 00:17:10,143
So let's go over back door
440
00:17:10,399 --> 00:17:12,703
Let's instantiate a child scene
441
00:17:12,959 --> 00:17:13,983
Hitbox component
442
00:17:14,239 --> 00:17:16,287
I want ad with control a
443
00:17:16,799 --> 00:17:17,567
A collision shape
444
00:17:18,335 --> 00:17:19,615
2D underneath app
445
00:17:20,383 --> 00:17:22,687
Let's create a new circle shape
446
00:17:22,943 --> 00:17:24,479
And actually the default
447
00:17:24,735 --> 00:17:25,759
Shape here
448
00:17:26,015 --> 00:17:27,039
I'm in the shape of you
449
00:17:27,295 --> 00:17:29,855
Is actually fine I think that's great so
450
00:17:30,111 --> 00:17:30,879
That's all good
451
00:17:31,135 --> 00:17:33,951
And then we've got our collision layer
452
00:17:34,207 --> 00:17:35,231
Witcher 2 enemy
453
00:17:35,487 --> 00:17:36,255
That's good
454
00:17:36,511 --> 00:17:38,303
And I believe that
455
00:17:38,815 --> 00:17:41,631
That should basically be anything everything that we do
456
00:17:41,887 --> 00:17:44,191
Now we do need to assign a dam
457
00:17:44,703 --> 00:17:45,471
To the app
458
00:17:45,727 --> 00:17:46,239
Ability
459
00:17:46,751 --> 00:17:50,079
And so they were doing that in our sword ability if I open this app
460
00:17:50,335 --> 00:17:51,103
Is where
461
00:17:51,359 --> 00:17:54,175
Resetting a damage in the sword ability control
462
00:17:54,687 --> 00:17:56,991
And then were passing at damage down
463
00:17:57,503 --> 00:17:58,783
Online for tea here
464
00:17:59,039 --> 00:17:59,551
To that
465
00:17:59,807 --> 00:18:00,575
Box can't
466
00:18:01,087 --> 00:18:02,111
Which vein carries blood
467
00:18:02,367 --> 00:18:02,879
Switch to Vienna
468
00:18:03,135 --> 00:18:06,207
So let's do the same thing in our accessibility controller let's Create
469
00:18:06,463 --> 00:18:08,255
A vast damage at the top
470
00:18:08,511 --> 00:18:09,791
We can send it to something
471
00:18:10,047 --> 00:18:10,559
Like 10
472
00:18:10,815 --> 00:18:15,167
And what we're going to do is we are going to before we go any further
473
00:18:15,423 --> 00:18:17,471
Dark tour accessibility
474
00:18:17,727 --> 00:18:19,007
Open up that script
475
00:18:19,263 --> 00:18:23,615
And we need to get a reference to the hitbox components let's say on ready
476
00:18:24,127 --> 00:18:26,175
Hitbox underscore
477
00:18:26,431 --> 00:18:26,943
Component
478
00:18:27,199 --> 00:18:28,223
Is equal to
479
00:18:28,735 --> 00:18:29,247
Hip hop
480
00:18:30,527 --> 00:18:34,623
Ok so that should be all we need let's go back to the accessibility controller gdpr
481
00:18:35,135 --> 00:18:35,647
In The Script
482
00:18:35,903 --> 00:18:36,671
Waste here
483
00:18:37,695 --> 00:18:39,487
When we create is acts instance
484
00:18:39,743 --> 00:18:41,791
Let's go ahead and add new line
485
00:18:42,047 --> 00:18:44,095
ASUS instant start hitbox
486
00:18:45,119 --> 00:18:45,631
Compound
487
00:18:45,887 --> 00:18:46,911
Damn
488
00:18:47,423 --> 00:18:48,447
Is equal to
489
00:18:48,703 --> 00:18:49,215
Damage
490
00:18:50,751 --> 00:18:53,823
Now we did that rain the action by destroying Anna
491
00:18:54,079 --> 00:18:55,103
Let's go ahead and see
492
00:18:55,359 --> 00:18:58,175
Thorax is doing damage to enemies
493
00:19:00,479 --> 00:19:03,807
Atlas spruce up the accessibility just a little bit
494
00:19:04,063 --> 00:19:08,927
We're going to add a generation player so let's go out and add child node to the accessibility
495
00:19:09,183 --> 00:19:12,255
Animation player let's move it to the first child
496
00:19:12,511 --> 00:19:14,559
Create a new image by clicking this button here
497
00:19:14,815 --> 00:19:15,839
And a clicking new
498
00:19:16,095 --> 00:19:18,911
And create this as the default animation
499
00:19:19,167 --> 00:19:21,983
And I'm going to change the duration with the
500
00:19:22,495 --> 00:19:23,263
Marks over here
501
00:19:23,519 --> 00:19:24,287
2.5
502
00:19:24,543 --> 00:19:25,823
And I'm going to
503
00:19:26,079 --> 00:19:28,383
Click on my Sprite 2D
504
00:19:28,895 --> 00:19:30,687
Scroll down to
505
00:19:31,967 --> 00:19:35,039
Rotation here and I'm going to collect the key icon
506
00:19:35,295 --> 00:19:37,599
To add a new track and then click create
507
00:19:38,367 --> 00:19:41,951
Zoom in using the slider in the bottom right just a little
508
00:19:42,207 --> 00:19:45,535
And what I'm going to say is I'm gonna put a keyframe at the end
509
00:19:46,047 --> 00:19:47,839
Add .5 seconds by right click
510
00:19:48,095 --> 00:19:49,375
Clicking insert key
511
00:19:49,887 --> 00:19:52,191
Number to change this value to 300
512
00:19:53,727 --> 00:19:56,031
Ok then the final thing I'm going to do is
513
00:19:56,287 --> 00:19:59,871
Click this button to the far right over here that says animation looping
514
00:20:00,127 --> 00:20:00,895
Guardian quick
515
00:20:01,151 --> 00:20:03,967
And if you use this button here play the selected animation
516
00:20:04,223 --> 00:20:06,783
You can see that we've got in endlessly roti
517
00:20:07,039 --> 00:20:07,551
Axe
518
00:20:08,575 --> 00:20:14,719
So we can see how that looks in game the final thing you should do is turn on this toggle right here which is AutoPlay on load
519
00:20:14,975 --> 00:20:17,791
So we don't have to manually tell the animation and start playing
520
00:20:18,047 --> 00:20:19,071
It would just started
521
00:20:19,583 --> 00:20:21,119
Is the let's go and Run the game
522
00:20:22,399 --> 00:20:25,471
Perfect song we got a little bit more life in our axis
523
00:20:26,495 --> 00:20:28,799
There's more we can do but we'll see
524
00:20:29,055 --> 00:20:33,407
More of that stuff for the polishing that we do it later on in the core
525
00:20:33,919 --> 00:20:35,967
The final thing that I do want to do that
526
00:20:36,223 --> 00:20:36,991
Before
527
00:20:37,247 --> 00:20:38,015
We
528
00:20:38,271 --> 00:20:40,831
Do anything else is just as last little thing
529
00:20:42,111 --> 00:20:46,719
I want to randomise the starting rotation for the X so you'll notice that
530
00:20:46,975 --> 00:20:52,095
When the axes are flying they always rotate twice in they always end when they
531
00:20:52,351 --> 00:20:53,631
To the right of the
532
00:20:53,887 --> 00:20:55,679
And that's a little bit
533
00:20:56,191 --> 00:20:56,959
Uniform
534
00:20:57,215 --> 00:20:58,239
It's kind of boring
535
00:20:58,495 --> 00:21:03,359
So I'm just going to randomise the base rotation that were using for the app
536
00:21:03,871 --> 00:21:04,383
Initial
537
00:21:04,895 --> 00:21:08,479
In the way that I'm going to do that as I'm going to declare a variable up here
538
00:21:08,735 --> 00:21:11,295
Barbados underscore rotation
539
00:21:12,319 --> 00:21:14,111
Was that two Factor to that right
540
00:21:14,623 --> 00:21:17,952
Ok and then the ready method I'm going to above the tween
541
00:21:18,208 --> 00:21:20,512
Set base rotation is
542
00:21:20,768 --> 00:21:22,560
Go to Vector to.rye
543
00:21:23,072 --> 00:21:24,096
Rotated
544
00:21:24,352 --> 00:21:25,888
Then we're going to say randev
545
00:21:26,144 --> 00:21:26,656
Range
546
00:21:26,912 --> 00:21:27,424
0
547
00:21:27,680 --> 00:21:28,192
To tell
548
00:21:29,216 --> 00:21:29,728
Ok
549
00:21:29,984 --> 00:21:31,776
And then instead of
550
00:21:32,032 --> 00:21:34,592
Using backer to that right here in the Twin method
551
00:21:34,848 --> 00:21:36,896
Well I'm going to do is replace that with the base
552
00:21:38,432 --> 00:21:41,760
So what we should end up with now is that our access are all
553
00:21:42,016 --> 00:21:43,296
Sort of spawning and if you
554
00:21:44,064 --> 00:21:45,600
And ending in different place
555
00:21:47,136 --> 00:21:48,672
Ok so that's looking great
556
00:21:50,976 --> 00:21:52,512
That's good for RX
557
00:21:52,768 --> 00:21:56,864
Ability the next step is to make it appear as an upgrade option
558
00:21:57,120 --> 00:21:58,656
When the player levels up
37240
Can't find what you're looking for?
Get subtitles in any language from opensubtitles.com, and translate them here.