All language subtitles for 10. Targeting Enemies With Sword Ability

af Afrikaans
sq Albanian
am Amharic
ar Arabic
hy Armenian
az Azerbaijani
eu Basque
be Belarusian
bn Bengali
bs Bosnian
bg Bulgarian
ca Catalan
ceb Cebuano
ny Chichewa
zh-CN Chinese (Simplified)
zh-TW Chinese (Traditional)
co Corsican
hr Croatian
cs Czech
da Danish
nl Dutch
en English
eo Esperanto
et Estonian
tl Filipino
fi Finnish
fr French
fy Frisian
gl Galician
ka Georgian
de German
el Greek
gu Gujarati
ht Haitian Creole
ha Hausa
haw Hawaiian
iw Hebrew
hi Hindi
hmn Hmong
hu Hungarian
is Icelandic
ig Igbo
id Indonesian Download
ga Irish
it Italian
ja Japanese
jw Javanese
kn Kannada
kk Kazakh
km Khmer
ko Korean
ku Kurdish (Kurmanji)
ky Kyrgyz
lo Lao
la Latin
lv Latvian
lt Lithuanian
lb Luxembourgish
mk Macedonian
mg Malagasy
ms Malay
ml Malayalam
mt Maltese
mi Maori
mr Marathi
mn Mongolian
my Myanmar (Burmese)
ne Nepali
no Norwegian
ps Pashto
fa Persian
pl Polish
pt Portuguese
pa Punjabi
ro Romanian
ru Russian
sm Samoan
gd Scots Gaelic
sr Serbian
st Sesotho
sn Shona
sd Sindhi
si Sinhala
sk Slovak
sl Slovenian
so Somali
es Spanish
su Sundanese
sw Swahili
sv Swedish
tg Tajik
ta Tamil
te Telugu
th Thai
tr Turkish
uk Ukrainian
ur Urdu
uz Uzbek
vi Vietnamese
cy Welsh
xh Xhosa
yi Yiddish
yo Yoruba
zu Zulu
or Odia (Oriya)
rw Kinyarwanda
tk Turkmen
tt Tatar
ug Uyghur
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:00,768 Of course 2 00:00:01,024 --> 00:00:06,144 We don't really have a game unless our sword ability can actually kill an enemy 3 00:00:06,400 --> 00:00:06,912 So 4 00:00:07,168 --> 00:00:08,960 Let's go ahead and do that 5 00:00:09,216 --> 00:00:12,544 A couple of things that we need to do the first question that we need to answer it 6 00:00:12,800 --> 00:00:15,616 How do we know where are the enemies are 7 00:00:15,872 --> 00:00:16,384 In the 8 00:00:16,640 --> 00:00:20,224 And the way that were going to do that as we're going to use a strategy similar 9 00:00:20,736 --> 00:00:22,016 To Howie 10 00:00:22,272 --> 00:00:24,064 The player position from the game camera 11 00:00:24,576 --> 00:00:25,600 I'm going to add 12 00:00:25,856 --> 00:00:26,368 The enemy 13 00:00:26,624 --> 00:00:27,392 2 and 10 14 00:00:27,648 --> 00:00:28,160 Is group 15 00:00:28,672 --> 00:00:30,208 So let's go ahead and 16 00:00:30,464 --> 00:00:33,024 Go into a basic enemy by clicking on 17 00:00:33,280 --> 00:00:35,072 The icon from the main theme 18 00:00:35,328 --> 00:00:36,864 And when I click on the route 19 00:00:37,376 --> 00:00:38,656 I'm going to click on the 20 00:00:38,912 --> 00:00:39,424 No 21 00:00:39,680 --> 00:00:40,192 Dark 22 00:00:40,448 --> 00:00:40,960 Tabs 23 00:00:41,472 --> 00:00:42,496 Guiding click on 24 00:00:43,008 --> 00:00:44,544 And then we're going to add 25 00:00:44,800 --> 00:00:45,312 The 26 00:00:45,568 --> 00:00:46,336 Anime to 27 00:00:47,360 --> 00:00:47,872 Ok 28 00:00:48,384 --> 00:00:50,688 So now anime is in the anime group 29 00:00:51,200 --> 00:00:55,808 Let's go to our sword ability Now control shift to open 30 00:00:56,064 --> 00:00:57,344 Quick opensea 31 00:00:57,600 --> 00:01:00,525 Can you get your sword ability controller in open that up 32 00:01:00,527 --> 00:01:02,875 Subtitled by online-courses.club We compress knowledge for you! 33 00:01:02,876 --> 00:01:04,000 And then click the Script icon to open up the screen 34 00:01:04,512 --> 00:01:06,560 So we're currently spawning a sword in 35 00:01:06,816 --> 00:01:08,096 At the player 36 00:01:08,608 --> 00:01:10,400 But we probably want to spoil the song 37 00:01:10,656 --> 00:01:11,424 Instance 38 00:01:13,728 --> 00:01:15,264 So how are we going to do that 39 00:01:15,776 --> 00:01:18,592 We're going to get rid of this black here we're getting a fur 40 00:01:18,848 --> 00:01:21,408 No dim repair where to change this to 41 00:01:21,664 --> 00:01:24,224 Enemies is equal to 42 00:01:26,016 --> 00:01:27,296 Get nodes 43 00:01:27,552 --> 00:01:28,064 In 44 00:01:29,600 --> 00:01:30,368 And then 45 00:01:30,880 --> 00:01:35,488 Ok and then we're going to need to do a simple check here we're going to get rid of player lying here 46 00:01:35,744 --> 00:01:38,048 And then I'm here we're going to say if enemies 47 00:01:39,328 --> 00:01:40,352 Shot size 48 00:01:41,120 --> 00:01:46,240 Is equal to 0 which means that we have no elements in the array does no enemies 49 00:01:46,496 --> 00:01:48,800 The screen will just going to return out of that 50 00:01:49,056 --> 00:01:51,360 So that we don't even try to spawn the sort of there's no 51 00:01:52,128 --> 00:01:56,992 Ok now we're gonna get an error here and that's fine I'm just going to comment this out for now by hidden control 52 00:01:57,248 --> 00:01:57,760 And then 53 00:01:58,016 --> 00:01:58,528 Ok 54 00:01:58,784 --> 00:02:02,112 So control cable automatically comment there was line so they don't 55 00:02:02,624 --> 00:02:03,136 Take off 56 00:02:03,648 --> 00:02:06,208 And there is one thing that we want to do with his enemies which is 57 00:02:06,720 --> 00:02:07,232 We were 58 00:02:07,488 --> 00:02:09,792 How to only get the enemy 59 00:02:10,048 --> 00:02:12,864 Is that are within a certain distance of 60 00:02:13,120 --> 00:02:13,632 The player 61 00:02:13,888 --> 00:02:19,520 Because if there's an enemy that off screen we don't want the sword which is kind of like a melee ability 62 00:02:20,032 --> 00:02:21,056 To be able to hear that 63 00:02:21,568 --> 00:02:24,128 So let's declare a constant 64 00:02:24,384 --> 00:02:24,896 Up here 65 00:02:25,152 --> 00:02:25,664 Con 66 00:02:25,920 --> 00:02:26,944 Max Rayne 67 00:02:27,456 --> 00:02:28,992 I want to set it to something like 68 00:02:29,248 --> 00:02:30,016 104 69 00:02:31,040 --> 00:02:32,064 So there is a Max 70 00:02:32,576 --> 00:02:34,368 Configurable if you want 71 00:02:34,624 --> 00:02:35,392 By doing 72 00:02:35,904 --> 00:02:36,416 At 73 00:02:36,928 --> 00:02:37,440 Export 74 00:02:37,952 --> 00:02:38,464 Bar 75 00:02:38,720 --> 00:02:39,232 Mark 76 00:02:39,744 --> 00:02:40,256 Range 77 00:02:41,536 --> 00:02:43,840 You can do that if you want it to be configurable 78 00:02:44,096 --> 00:02:45,120 My inspector 79 00:02:45,632 --> 00:02:46,144 Right here 80 00:02:46,656 --> 00:02:51,008 Music on speakers I don't foresee this variable needing to be changed 81 00:02:51,264 --> 00:02:51,776 At all 82 00:02:52,032 --> 00:02:55,104 So we're going to go back down to her on time or time out here 83 00:02:55,360 --> 00:02:56,896 I'm going to say enemies 84 00:02:57,152 --> 00:02:59,456 Is equal to enemies dot 85 00:03:00,736 --> 00:03:03,040 So what we going to do is we're going to pass on 86 00:03:03,296 --> 00:03:04,064 Filter mesh 87 00:03:04,576 --> 00:03:05,856 So in the filter function 88 00:03:06,112 --> 00:03:08,416 We can actually pass what is called 89 00:03:08,928 --> 00:03:09,952 Filter function 90 00:03:10,208 --> 00:03:10,976 Which is 91 00:03:11,232 --> 00:03:15,072 A function that takes each element in the array 92 00:03:15,328 --> 00:03:15,840 Argument 93 00:03:16,096 --> 00:03:18,400 And can return either true or false 94 00:03:18,656 --> 00:03:19,424 To decide 95 00:03:19,680 --> 00:03:22,240 Whether that element should be preserved in the for 96 00:03:22,752 --> 00:03:24,800 So you can imagine like a real life filter 97 00:03:25,312 --> 00:03:27,360 You have it blacked out 98 00:03:27,616 --> 00:03:29,664 Certain things so if you have a water filter 99 00:03:29,920 --> 00:03:31,968 It let's all the waters there's a film 100 00:03:32,224 --> 00:03:32,736 An 101 00:03:32,992 --> 00:03:35,296 Prevents all the sediment from 102 00:03:35,808 --> 00:03:37,344 So it's the same way with 103 00:03:37,600 --> 00:03:39,136 Filter function with data 104 00:03:39,648 --> 00:03:40,416 With an array 105 00:03:40,672 --> 00:03:44,000 We can run a function against each element to the term 106 00:03:44,256 --> 00:03:46,304 If that element should be filtered 107 00:03:46,560 --> 00:03:47,072 Or not 108 00:03:47,584 --> 00:03:49,376 And so in here what I'm going to do is it going to rain 109 00:03:49,888 --> 00:03:50,400 Funk 110 00:03:50,656 --> 00:03:52,448 And then parentheses enemy 111 00:03:52,960 --> 00:03:56,544 We're going to specify this enemy is a type of no 2D 112 00:03:57,056 --> 00:03:58,592 So that we can get suggestions 113 00:03:58,848 --> 00:03:59,872 I'm going to call 114 00:04:00,384 --> 00:04:01,152 Return 115 00:04:01,664 --> 00:04:02,176 Anime 116 00:04:02,432 --> 00:04:03,712 Global position 117 00:04:03,968 --> 00:04:06,016 Distance squared 118 00:04:06,272 --> 00:04:06,784 Tool 119 00:04:07,040 --> 00:04:08,576 And we're going to check 120 00:04:08,832 --> 00:04:10,880 The distance squared to the player 121 00:04:11,136 --> 00:04:11,648 Position 122 00:04:11,904 --> 00:04:12,672 Is 123 00:04:12,928 --> 00:04:14,208 West Ham the maximum 124 00:04:14,720 --> 00:04:18,815 Before we do that we're going to make this a little bit nicer by 125 00:04:19,071 --> 00:04:20,095 Formatting as well babe 126 00:04:20,351 --> 00:04:24,191 So if I go to my return key word here and I just press 127 00:04:24,447 --> 00:04:25,983 Enter to create a new line 128 00:04:26,495 --> 00:04:31,615 We can do that and then I need to move the end parentheses of you highlight Apprentice 129 00:04:31,871 --> 00:04:34,431 It will show you where the matching printer 130 00:04:34,687 --> 00:04:37,503 Underline underneath of parentheses 131 00:04:37,759 --> 00:04:38,783 You can see that 132 00:04:39,039 --> 00:04:40,319 Is underlined the 133 00:04:40,575 --> 00:04:42,623 Opposing for a disease over here to begin 134 00:04:42,879 --> 00:04:43,391 The filter 135 00:04:43,647 --> 00:04:44,159 Funk 136 00:04:44,671 --> 00:04:47,231 And so just before that one I'm going to hit enter again 137 00:04:47,743 --> 00:04:48,767 Depressed 138 00:04:49,023 --> 00:04:50,559 Tab to unintended 139 00:04:50,815 --> 00:04:52,095 To preserve the proper in 140 00:04:53,119 --> 00:04:57,471 And then here we still got an error but if we want to see if this works I can just take control care 141 00:04:57,983 --> 00:04:58,495 To come in 142 00:04:59,775 --> 00:05:01,311 Indent there's a couple of times 143 00:05:02,079 --> 00:05:02,591 And then 144 00:05:02,847 --> 00:05:03,359 Return 145 00:05:04,383 --> 00:05:07,711 Solicitor very barebones filter function that will just feel throughout everything 146 00:05:07,967 --> 00:05:09,503 So this Returns true 147 00:05:09,759 --> 00:05:10,783 Element Andrew 148 00:05:11,807 --> 00:05:15,903 Well described the elements so if we were the right like this we were filled out every single 149 00:05:16,159 --> 00:05:18,975 I'm just going to keep it there for now just as demonstration purpose 150 00:05:19,231 --> 00:05:20,255 We do need to 151 00:05:20,511 --> 00:05:21,279 The player position 152 00:05:21,535 --> 00:05:22,303 Again then 153 00:05:22,559 --> 00:05:24,863 I'm gonna put that line back that we had before 154 00:05:25,119 --> 00:05:27,423 Vera-playa equals get three dots 155 00:05:27,679 --> 00:05:28,191 First 156 00:05:28,703 --> 00:05:29,471 No dim 157 00:05:31,263 --> 00:05:31,775 Claire 158 00:05:32,031 --> 00:05:33,055 As note 159 00:05:33,823 --> 00:05:37,919 Ok so back to our filter function I'm going to remove this hard couldn't fault here 160 00:05:38,175 --> 00:05:40,223 I'm a presscontrol k on this line 161 00:05:40,735 --> 00:05:41,503 To remove 162 00:05:42,015 --> 00:05:42,527 The car 163 00:05:43,039 --> 00:05:45,855 And then remember what we doing here is worth checking 164 00:05:46,111 --> 00:05:47,135 If the distance 165 00:05:47,391 --> 00:05:47,903 Square 166 00:05:48,159 --> 00:05:48,671 2 167 00:05:49,183 --> 00:05:49,951 The player 168 00:05:50,207 --> 00:05:51,231 Is greater than 169 00:05:51,487 --> 00:05:51,999 The match 170 00:05:52,255 --> 00:05:52,767 Range 171 00:05:53,023 --> 00:05:56,351 Or in this case we wanted to be less than the maximum sort Returns true 172 00:05:56,863 --> 00:05:57,631 And preserve the 173 00:05:57,887 --> 00:06:00,959 And again we're doing distance squared to because 174 00:06:01,471 --> 00:06:03,775 Square calculation actually required 175 00:06:04,031 --> 00:06:06,079 Fewer CPU Cycles compared 176 00:06:06,591 --> 00:06:07,103 Atypical 177 00:06:07,359 --> 00:06:08,639 Square root operation 178 00:06:08,895 --> 00:06:10,687 And so when you're dealing with large list 179 00:06:10,943 --> 00:06:11,967 This was actually 180 00:06:12,223 --> 00:06:12,735 Match 181 00:06:13,503 --> 00:06:14,783 So distance squared to 182 00:06:15,039 --> 00:06:17,087 What can I put in as the argument there 183 00:06:17,343 --> 00:06:17,855 Player 184 00:06:18,111 --> 00:06:19,647 Dot global position 185 00:06:20,927 --> 00:06:22,719 And then we're going to say is last 186 00:06:23,231 --> 00:06:23,999 How 187 00:06:24,511 --> 00:06:25,535 Max range 188 00:06:26,303 --> 00:06:26,815 2 189 00:06:27,583 --> 00:06:29,887 So when you do a Distance squared to check 190 00:06:30,143 --> 00:06:32,447 This is going to get the squared 191 00:06:32,703 --> 00:06:34,239 From the enemy to the player 192 00:06:34,495 --> 00:06:37,567 That means that the Range that were checking also 193 00:06:37,823 --> 00:06:38,335 To be square 194 00:06:38,591 --> 00:06:39,871 So instead of using 195 00:06:40,127 --> 00:06:41,919 Match range we have to use mate 196 00:06:42,175 --> 00:06:43,199 Change x Max 197 00:06:44,735 --> 00:06:45,247 Squared 198 00:06:45,503 --> 00:06:47,295 So again this will filter out 199 00:06:47,551 --> 00:06:48,319 Every Anna 200 00:06:48,575 --> 00:06:49,855 That is further than 201 00:06:50,111 --> 00:06:52,159 150 pixels away 202 00:06:52,415 --> 00:06:53,439 From the player 203 00:06:53,695 --> 00:06:55,487 And we're signing it here 204 00:06:55,743 --> 00:06:58,047 Right enemies is equal to enemies that filter 205 00:06:58,303 --> 00:06:59,583 Because this filter function 206 00:07:00,095 --> 00:07:01,631 If I bring up my documentation 207 00:07:01,887 --> 00:07:03,423 By clicking F1 208 00:07:03,679 --> 00:07:04,447 On my keep 209 00:07:04,703 --> 00:07:05,471 If I look 210 00:07:05,983 --> 00:07:06,751 Theory test 211 00:07:07,263 --> 00:07:08,031 And click 212 00:07:08,287 --> 00:07:09,311 I can scroll down 213 00:07:09,823 --> 00:07:10,335 And find 214 00:07:10,591 --> 00:07:11,359 Motor function 215 00:07:11,615 --> 00:07:13,151 And you can see that the return type 216 00:07:13,407 --> 00:07:14,175 Is listed 217 00:07:14,431 --> 00:07:16,223 Arsenal left of the filter 218 00:07:16,479 --> 00:07:18,527 So it's going to return a new array 219 00:07:19,039 --> 00:07:20,831 So and you can read the documentation as well 220 00:07:21,343 --> 00:07:22,623 Which will tell you here 221 00:07:22,879 --> 00:07:24,159 It returns a new array 222 00:07:24,671 --> 00:07:29,023 So again the documentation is always there if you're confused about anything that I'm going over 223 00:07:29,279 --> 00:07:30,047 Please feel free 224 00:07:30,303 --> 00:07:31,071 Pause the video 225 00:07:31,327 --> 00:07:32,351 Open up the door 226 00:07:32,607 --> 00:07:33,119 Station 227 00:07:33,375 --> 00:07:35,935 And just do a little bit of Reading if something I'm saying is 228 00:07:36,703 --> 00:07:37,727 But moving on 229 00:07:37,983 --> 00:07:38,495 2 230 00:07:39,007 --> 00:07:39,775 The rest of this 231 00:07:40,287 --> 00:07:42,079 So now we've got our filter Denham 232 00:07:42,335 --> 00:07:44,383 All the animals are close enough to the play 233 00:07:44,639 --> 00:07:46,175 To be able to use the sword ability 234 00:07:46,431 --> 00:07:49,247 I'm sorry we're going to want to put that cheque back into 235 00:07:49,759 --> 00:07:50,271 So 236 00:07:51,039 --> 00:07:52,575 Where is equal then now 237 00:07:53,855 --> 00:07:55,391 So can't be too 238 00:07:56,415 --> 00:07:59,231 Ok so now we've got Oliver check down in Oliver 239 00:07:59,487 --> 00:08:00,511 Setup done 240 00:08:00,767 --> 00:08:03,071 Now we actually want to take 241 00:08:03,327 --> 00:08:05,631 Closest enemy in attack on that 242 00:08:05,887 --> 00:08:07,423 So I want to do is wee wee 243 00:08:07,679 --> 00:08:08,703 Call enemies 244 00:08:08,959 --> 00:08:09,983 Darts 245 00:08:10,239 --> 00:08:10,751 Cus 246 00:08:11,263 --> 00:08:14,335 And in here within a provide a sorting function 247 00:08:14,591 --> 00:08:15,359 Which is 248 00:08:15,615 --> 00:08:16,127 Funk 249 00:08:17,663 --> 00:08:18,687 No to die 250 00:08:19,199 --> 00:08:19,711 Karma 251 00:08:19,967 --> 00:08:20,735 For a second 252 00:08:20,991 --> 00:08:21,503 B 253 00:08:21,759 --> 00:08:23,295 Colin no to do so again 254 00:08:23,551 --> 00:08:25,087 Or typing elements 255 00:08:26,367 --> 00:08:27,135 And then a cold 256 00:08:27,391 --> 00:08:27,903 The end of that 257 00:08:28,159 --> 00:08:30,719 But hit return and then unindent 258 00:08:30,975 --> 00:08:33,535 So that way with God are formatted correctly 259 00:08:33,791 --> 00:08:38,911 And just a quick note about the Sorting function so the way that sorting works across a Friday 260 00:08:39,167 --> 00:08:41,471 Languages is Dad new passing a function 261 00:08:41,727 --> 00:08:44,031 That Compares element 88 helmet 262 00:08:44,287 --> 00:08:45,311 So it gives you 263 00:08:45,567 --> 00:08:46,591 Pairs at a time 264 00:08:47,103 --> 00:08:48,895 And you as the developer 265 00:08:49,151 --> 00:08:49,919 To tell 266 00:08:50,175 --> 00:08:50,687 Weather 267 00:08:50,943 --> 00:08:52,479 It should be sorted before 268 00:08:52,735 --> 00:08:53,759 B and 269 00:08:54,015 --> 00:08:56,063 Works the same way in Jesus Christ 270 00:08:56,319 --> 00:08:58,623 We've got our a enemy and our 271 00:08:58,879 --> 00:08:59,647 B&M 272 00:09:00,159 --> 00:09:02,207 And we're going to grab the Disco 273 00:09:02,719 --> 00:09:05,023 To the player for each of those enemies 274 00:09:05,279 --> 00:09:06,815 And then return true 275 00:09:07,327 --> 00:09:10,655 If a is closer because we want a to be sorted 276 00:09:10,911 --> 00:09:17,055 First is this is unclear what you can do is again open up your documentation with f 277 00:09:17,567 --> 00:09:18,335 You can actually 278 00:09:18,591 --> 00:09:19,103 Bye 279 00:09:19,359 --> 00:09:21,151 The method name that you're having trouble 280 00:09:22,175 --> 00:09:22,687 Type 281 00:09:22,943 --> 00:09:23,967 Sort custom here 282 00:09:24,223 --> 00:09:27,551 That brings me right to the erase awesome and I can click into that 283 00:09:27,807 --> 00:09:30,111 And this will give me a lot of useful information 284 00:09:30,367 --> 00:09:32,415 How does sorting actually work 285 00:09:32,671 --> 00:09:38,815 Any point doing this you're unsure of the exact behaviour of a function that were using the overall pass 286 00:09:39,071 --> 00:09:41,375 Video open up the documentation in read 287 00:09:41,631 --> 00:09:42,143 What 288 00:09:42,399 --> 00:09:42,911 Function 289 00:09:43,167 --> 00:09:43,679 Does 290 00:09:43,935 --> 00:09:48,031 So we need to grab the a Distance so a underscore distance 291 00:09:48,287 --> 00:09:49,311 Is equal to 292 00:09:49,567 --> 00:09:51,615 A global position 293 00:09:51,871 --> 00:09:56,223 Where can you use distance squared to again for the same reason that we did above 294 00:09:56,991 --> 00:09:58,015 Inside edition 295 00:09:58,271 --> 00:10:00,063 Squared to the player global 296 00:10:00,345 --> 00:10:02,632 Subtitled by online-courses.club We compress knowledge for you! 297 00:10:02,634 --> 00:10:02,623 I'm just going to keep that 298 00:10:03,391 --> 00:10:06,463 Unless duplicate this line solutions copy and paste 299 00:10:06,975 --> 00:10:07,999 I'm going to change this 300 00:10:08,255 --> 00:10:09,023 Be distance 301 00:10:09,279 --> 00:10:12,863 And be very short to change this to be Da Club up 302 00:10:13,631 --> 00:10:15,935 I know we're just going to return a distance 303 00:10:16,191 --> 00:10:17,727 Is less than 304 00:10:18,751 --> 00:10:20,031 So again if this 305 00:10:20,543 --> 00:10:24,127 Sorting function Returns true that means that a should be sorted 306 00:10:24,383 --> 00:10:24,895 Before 307 00:10:25,151 --> 00:10:25,663 B 308 00:10:25,919 --> 00:10:28,223 Andover minor type of here this needs to be 2D 309 00:10:28,479 --> 00:10:29,247 Capitalise 310 00:10:29,503 --> 00:10:30,015 What is fixed 311 00:10:30,271 --> 00:10:32,575 So now we got a sorted Enemy Away 312 00:10:32,831 --> 00:10:36,415 And we already know that the enemy size is greater than 0 313 00:10:36,671 --> 00:10:37,183 So 314 00:10:37,439 --> 00:10:39,231 Replace this comment out line 315 00:10:39,743 --> 00:10:42,047 So player get parent and Child 316 00:10:42,815 --> 00:10:48,959 Ring keep this line actually because we're going to tell the sword to go into the tree somewhere for keeping this line to add child 317 00:10:49,215 --> 00:10:53,055 What we're going to change is the global positions what's on comment that line as well 318 00:10:53,567 --> 00:10:55,359 Instead of playing at global position 319 00:10:55,871 --> 00:10:58,175 What we're going to do is ringing to say enemies 320 00:10:58,431 --> 00:10:59,711 At index 0 321 00:10:59,967 --> 00:11:01,247 So the first enemy 322 00:11:01,503 --> 00:11:02,527 In the sorted array 323 00:11:02,783 --> 00:11:04,063 Will be the closest anime 324 00:11:04,575 --> 00:11:05,343 And it will be a 325 00:11:05,855 --> 00:11:06,367 That 326 00:11:06,879 --> 00:11:10,463 So let's go and test this but first let's go back to our main scene 327 00:11:10,719 --> 00:11:11,999 And click on the 2D 328 00:11:12,255 --> 00:11:13,023 Set the top to go bye 329 00:11:13,279 --> 00:11:13,791 2 hour 330 00:11:14,047 --> 00:11:14,815 Scene view 331 00:11:15,071 --> 00:11:20,447 And I'm just going to go ahead and duplicate this enemy by selecting it and pressing ctrl d 332 00:11:20,703 --> 00:11:21,983 And I've got a second-hand 333 00:11:22,239 --> 00:11:23,519 I'm going to hit w 334 00:11:23,775 --> 00:11:25,311 To enable the move tool 335 00:11:25,567 --> 00:11:27,103 Then I'm going to move that second enemy 336 00:11:27,615 --> 00:11:28,127 Fire away 337 00:11:28,639 --> 00:11:29,663 So let's go ahead and play 338 00:11:30,943 --> 00:11:34,527 I can see that the sword is always attacking this rat first 339 00:11:34,783 --> 00:11:37,599 Because that's the closest one now if I switch directions 340 00:11:37,855 --> 00:11:39,391 Responding on that one 341 00:11:39,647 --> 00:11:43,231 Now that we've got the sword tiling the proper anime 342 00:11:43,487 --> 00:11:44,511 Wheel cover 343 00:11:44,767 --> 00:11:48,863 How to actually make the sword kill the enemy in the next lesson 21672

Can't find what you're looking for?
Get subtitles in any language from opensubtitles.com, and translate them here.