All language subtitles for lesson118

af Afrikaans
ak Akan
sq Albanian
am Amharic
ar Arabic
hy Armenian
az Azerbaijani
eu Basque
be Belarusian
bem Bemba
bn Bengali
bh Bihari
bs Bosnian
br Breton
bg Bulgarian
km Cambodian
ca Catalan
chr Cherokee
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
ee Ewe
fo Faroese
tl Filipino
fi Finnish
fr French
fy Frisian
gaa Ga
gl Galician
ka Georgian
de German
el Greek
gn Guarani
gu Gujarati
ht Haitian Creole
ha Hausa
haw Hawaiian
iw Hebrew
hi Hindi
hu Hungarian
is Icelandic
ig Igbo
id Indonesian
ia Interlingua
ga Irish
it Italian
ja Japanese
jw Javanese
kn Kannada
kk Kazakh
rw Kinyarwanda
rn Kirundi
kg Kongo
ko Korean
kri Krio (Sierra Leone)
ku Kurdish
ckb Kurdish (Soranî)
ky Kyrgyz
lo Laothian
la Latin
lv Latvian
ln Lingala
lt Lithuanian
loz Lozi
lg Luganda
ach Luo
mk Macedonian
mg Malagasy
ms Malay
ml Malayalam
mt Maltese
mi Maori
mr Marathi
mfe Mauritian Creole
mo Moldavian
mn Mongolian
sr-ME Montenegrin
ne Nepali
pcm Nigerian Pidgin
nso Northern Sotho
no Norwegian
nn Norwegian (Nynorsk)
oc Occitan
or Oriya
om Oromo
ps Pashto
fa Persian
pl Polish
pt-BR Portuguese (Brazil)
pt-PT Portuguese (Portugal)
pa Punjabi
qu Quechua
ro Romanian
rm Romansh
nyn Runyakitara
ru Russian Download
gd Scots Gaelic
sr Serbian
sh Serbo-Croatian
st Sesotho
tn Setswana
crs Seychellois Creole
sn Shona
sd Sindhi
si Sinhalese
sk Slovak
sl Slovenian
so Somali
es Spanish
es-419 Spanish (Latin American)
su Sundanese
sw Swahili
sv Swedish
tg Tajik
ta Tamil
tt Tatar
te Telugu
th Thai
ti Tigrinya
to Tonga
lua Tshiluba
tum Tumbuka
tr Turkish
tk Turkmen
tw Twi
ug Uighur
uk Ukrainian
ur Urdu
uz Uzbek
vi Vietnamese
cy Welsh
wo Wolof
xh Xhosa
yi Yiddish
yo Yoruba
zu Zulu
Would you like to inspect the original subtitles? These are the user uploaded subtitles that are being translated: 1 00:00:06,656 --> 00:00:12,288 So we're going to add a component to our player here 2 00:00:12,800 --> 00:00:15,360 A component is called an enemy 3 00:00:15,872 --> 00:00:16,640 So type in 4 00:00:16,896 --> 00:00:17,664 Animator 5 00:00:18,176 --> 00:00:20,480 When adding your component in there we go 6 00:00:22,016 --> 00:00:28,160 In a minute can also be called on mechanism in a meter superhero Googling for solutions for your own 7 00:00:28,416 --> 00:00:31,232 Component you can Google mekanam animator 8 00:00:31,488 --> 00:00:34,816 Now the area allows us to create a tree 9 00:00:35,584 --> 00:00:36,864 Animations 10 00:00:37,120 --> 00:00:41,472 And then sort through those animations based on certain parameters 11 00:00:42,496 --> 00:00:48,384 I know that's confusing I know it doesn't make sense so I would recommend just following along with me and I don't make sense 12 00:00:48,640 --> 00:00:53,760 When she kind of practise a little bit movie watch this video maybe once or twice ok 13 00:00:54,016 --> 00:00:56,576 So when I click on window and go to 14 00:00:56,832 --> 00:00:57,856 Animation 15 00:00:58,624 --> 00:00:59,392 Animator 16 00:00:59,648 --> 00:01:00,141 Ok 17 00:01:00,143 --> 00:01:02,747 Subtitled by -♪ online-courses.club ♪- We compress knowledge for you! https://t.me/joinchat/ailxpXoW3JVjYzQ1 18 00:01:02,748 --> 00:01:03,488 And this is a wonderful confusing 19 00:01:03,744 --> 00:01:09,888 Window it's not as confusing as it looks already we got layers parameters but this weird 20 00:01:10,144 --> 00:01:12,704 Also I'm going to go ahead and get a window 21 00:01:12,960 --> 00:01:15,264 Animation in an animation 22 00:01:15,520 --> 00:01:17,824 And I'm really use this down here 23 00:01:18,080 --> 00:01:21,152 The animator window is where you manage 24 00:01:21,408 --> 00:01:23,200 Multiple animations 25 00:01:23,456 --> 00:01:27,040 Until unity which animation to play 26 00:01:27,552 --> 00:01:28,832 Based on certain parameters 27 00:01:29,600 --> 00:01:35,232 The animation window is where you actually enemy your character in the bones ok 28 00:01:35,488 --> 00:01:37,792 So this is why you handle multiple animations 29 00:01:38,048 --> 00:01:40,864 This is why you handle a single animation and what it does 30 00:01:41,120 --> 00:01:41,632 Ok 31 00:01:42,400 --> 00:01:45,216 So the first thing to do is just going to my scene view here 32 00:01:45,728 --> 00:01:50,336 And I'm going to go ahead in click create just to show you guys how this works 33 00:01:50,592 --> 00:01:52,640 Miniclip create animation 34 00:01:53,408 --> 00:01:56,480 Alright so it's like we can create a new folder 35 00:01:56,992 --> 00:01:58,784 And I think we should call this 36 00:01:59,040 --> 00:02:00,064 Animation 37 00:02:01,856 --> 00:02:03,648 Anything new folder called characters 38 00:02:04,672 --> 00:02:06,720 Inside that folder and create a new folder 39 00:02:07,232 --> 00:02:08,000 Call Claire 40 00:02:08,256 --> 00:02:12,864 And I can go ahead in name the first animation in Italy player 41 00:02:13,632 --> 00:02:17,728 Stand knows my syntax nice and clean capital space 42 00:02:17,984 --> 00:02:18,496 Stand 43 00:02:18,752 --> 00:02:19,264 Ok 44 00:02:20,544 --> 00:02:22,592 Alright so now we have this timeline 45 00:02:23,360 --> 00:02:25,152 If I click this record button 46 00:02:26,944 --> 00:02:30,784 I can actually move around various parts of my player 47 00:02:31,552 --> 00:02:34,880 And it will automatically create with cold keyframes 48 00:02:35,136 --> 00:02:39,744 And tell unity this is where I want the bones to be at this specific 49 00:02:40,000 --> 00:02:40,512 Frame 50 00:02:40,768 --> 00:02:42,560 As you can see here we can 51 00:02:42,816 --> 00:02:47,936 Click the record button and if we just simply drag the hands 52 00:02:48,448 --> 00:02:52,032 My down to aside here can I give standing in place maybe 53 00:02:52,800 --> 00:02:54,080 Do something like this 54 00:02:54,848 --> 00:03:00,224 It's adding these weird looking diamonds and all these are our indicators to show 55 00:03:00,480 --> 00:03:01,760 Hey unity 56 00:03:02,272 --> 00:03:05,344 This is the position at 0 right 57 00:03:05,600 --> 00:03:09,184 So I hit play what does only one frame so it just sort of stays there 58 00:03:09,952 --> 00:03:11,744 Spotify play mode 59 00:03:12,000 --> 00:03:13,024 Get see now 60 00:03:13,792 --> 00:03:14,816 My pleasure is 61 00:03:15,584 --> 00:03:16,096 Serve 62 00:03:16,352 --> 00:03:20,448 Lupin position is only one frame again but it's looking so he's 63 00:03:20,704 --> 00:03:23,776 Constantly playing this animation of him just standing there 64 00:03:24,544 --> 00:03:26,592 And if we go to our animator tab 65 00:03:26,848 --> 00:03:27,872 You can see 66 00:03:28,128 --> 00:03:30,944 We have 1 animation as got player stand 67 00:03:31,712 --> 00:03:33,248 And after entry 68 00:03:33,760 --> 00:03:35,040 We are going to 69 00:03:35,808 --> 00:03:38,880 Start the game and we're going to play this animation ok 70 00:03:39,392 --> 00:03:42,464 Is my nan make sense so just hold on tight 71 00:03:42,976 --> 00:03:46,816 And it will once we start messing around with various animations 72 00:03:47,840 --> 00:03:49,632 Now I want to give you a quick note 73 00:03:50,400 --> 00:03:52,192 If you guys aren't seeing 74 00:03:52,960 --> 00:03:54,240 Your skeleton here 75 00:03:54,496 --> 00:03:57,056 You want to make sure you click the sort of gizmos button 76 00:03:57,312 --> 00:03:58,592 If you don't see it highlighter 77 00:03:58,848 --> 00:04:04,992 You not going to see your bones you're not gonna be able to manipulate your character have definitely been confused before wondering where are my bones 78 00:04:05,248 --> 00:04:07,808 Just be sure to click it and turn it on 79 00:04:08,320 --> 00:04:10,880 And now we can actually manipulate our bones 80 00:04:11,392 --> 00:04:16,000 So when were in the standing animation we can actually move 81 00:04:17,791 --> 00:04:19,071 Are play head over 82 00:04:19,839 --> 00:04:21,119 You might say 83 00:04:22,143 --> 00:04:24,191 We want him to sort of breathe 84 00:04:24,959 --> 00:04:29,823 Every second right so we could actually move his arms up a little bit like he's breathing 85 00:04:30,847 --> 00:04:33,919 And maybe put him back in with his head like this 86 00:04:34,431 --> 00:04:35,711 But you noticed 87 00:04:35,967 --> 00:04:37,503 No keyframes 88 00:04:38,271 --> 00:04:39,295 To the timeline 89 00:04:39,807 --> 00:04:44,159 Or remember you got to be extra careful when you're working on your animations guys 90 00:04:44,671 --> 00:04:50,815 You nearly has I don't know it's not the best animation system I'll be honest because it default 91 00:04:51,071 --> 00:04:55,679 What's a preview mode when in reality I wish you would default to record mode ok 92 00:04:56,191 --> 00:05:00,031 So now the world record mode I can pull my play head over to One S 93 00:05:00,543 --> 00:05:03,359 And move his arms out just a little bit 94 00:05:03,615 --> 00:05:07,199 And maybe shift his chest a little bit so something like this see you there 95 00:05:07,711 --> 00:05:09,247 And I can highlight all of these 96 00:05:09,503 --> 00:05:11,039 Press ctrl-c to copy them 97 00:05:11,551 --> 00:05:14,879 Zoom out using the scroll wheel and get a 2 seconds 98 00:05:15,135 --> 00:05:15,903 And now 99 00:05:17,439 --> 00:05:18,463 He will stay in there 100 00:05:19,487 --> 00:05:20,255 Embryo 101 00:05:21,023 --> 00:05:21,791 Very cool 102 00:05:22,303 --> 00:05:22,815 Now 103 00:05:23,071 --> 00:05:27,167 We can also make him blink so let's go ahead and maybe startupblink here 104 00:05:27,679 --> 00:05:30,239 And again make sure they were on record mode 105 00:05:30,495 --> 00:05:32,287 I'm going to select this I hear 106 00:05:34,591 --> 00:05:36,639 There we go to scale 107 00:05:37,663 --> 00:05:40,479 And I'm going to shrink it down like the see that 108 00:05:40,991 --> 00:05:43,551 Why you want to be careful though because luck watch 109 00:05:44,319 --> 00:05:47,647 Is it a very slow blink 110 00:05:47,903 --> 00:05:51,487 So what am I to do is actually take the first frame and paste it 111 00:05:51,743 --> 00:05:54,047 Roundabout here and then another one right here 112 00:05:54,303 --> 00:05:54,815 Do that 113 00:05:55,327 --> 00:05:56,095 So now 114 00:05:57,119 --> 00:05:58,143 Is blinkers fast 115 00:06:01,471 --> 00:06:02,239 Here we go 116 00:06:03,263 --> 00:06:09,407 So what's occurring by the way there's something called cleaning in twinnings was started a long time ago more than a decade 117 00:06:09,663 --> 00:06:13,247 No between basically means you don't need the enemy frame-by-frame guys 118 00:06:13,759 --> 00:06:15,551 If you're making a game like hollow Knight 119 00:06:16,063 --> 00:06:18,367 You gonna use a lot of frame by frame animations 120 00:06:18,623 --> 00:06:24,767 But I'll be honest I play that game and I realise there's some Twinning going on as well basically between means is indicating 121 00:06:25,023 --> 00:06:26,303 And keyframe position 122 00:06:26,559 --> 00:06:32,703 Mnm other keeping position in unity with some math is got fill in the gaps here's an example 123 00:06:32,959 --> 00:06:36,031 If I rotate the head like this and I rotate the Head Like This 124 00:06:36,799 --> 00:06:40,639 That's 2 frames but unity is going to fill in the gaps for me 125 00:06:41,151 --> 00:06:47,295 So that's what makes animation so much easier in 2020 as opposed to in 1992 126 00:06:48,319 --> 00:06:53,695 Ok so I'm going to delete those head rotation and just going to delete the entire property right here 127 00:06:54,463 --> 00:06:55,231 And 128 00:06:55,487 --> 00:06:56,767 Let's take a look here 129 00:06:57,023 --> 00:06:59,583 How to get one eye blinking what's the other one 130 00:06:59,839 --> 00:07:00,607 It's like that 131 00:07:01,119 --> 00:07:03,167 Make sure we're on record mode 132 00:07:03,423 --> 00:07:06,751 So what I'm going to do is I'm going to go to this key from here 133 00:07:07,263 --> 00:07:09,567 Stream down the size and then again 134 00:07:10,079 --> 00:07:10,591 Copy 135 00:07:10,847 --> 00:07:14,687 The first name of this property which is a right scale 136 00:07:14,943 --> 00:07:15,967 Inner peace 137 00:07:16,223 --> 00:07:16,991 MPC here 138 00:07:21,599 --> 00:07:23,391 So now he breaks what's going on here 139 00:07:23,903 --> 00:07:24,927 And see how it looks 140 00:07:30,047 --> 00:07:31,071 What is blinking 141 00:07:31,583 --> 00:07:32,095 And 142 00:07:32,351 --> 00:07:34,143 Barely breathing very cool 143 00:07:35,167 --> 00:07:35,935 Awesome 144 00:07:36,447 --> 00:07:37,983 I definitely like the way that looks 145 00:07:38,751 --> 00:07:39,519 Ok 146 00:07:40,287 --> 00:07:40,799 So 147 00:07:41,567 --> 00:07:42,079 What's 148 00:07:42,335 --> 00:07:43,103 Go ahead 149 00:07:44,383 --> 00:07:45,407 And talk about something 150 00:07:45,663 --> 00:07:47,711 That is a little bit complicated 151 00:07:47,967 --> 00:07:50,527 But I believe strongly 152 00:07:50,783 --> 00:07:52,831 Then I can help it make sense 153 00:07:53,087 --> 00:07:57,439 You guys better than a lot of people try to make it make sense to me ok 154 00:07:57,695 --> 00:08:01,023 Can I go ahead and click on the enemy tab ok 155 00:08:01,791 --> 00:08:06,911 There's layers going to target layers in future episodes it might even be in the events section 156 00:08:07,423 --> 00:08:10,495 But right now we're just going to go to parameters ok 157 00:08:11,519 --> 00:08:13,567 What does tab mean is 158 00:08:13,823 --> 00:08:15,359 What parameters 159 00:08:15,615 --> 00:08:16,895 Are associated 160 00:08:17,151 --> 00:08:17,919 With 161 00:08:18,431 --> 00:08:19,711 The animator 162 00:08:20,479 --> 00:08:26,111 Well if I create a parameter let's see here and let's see what can we do that's create 163 00:08:26,367 --> 00:08:27,903 Will you create a parameter called 164 00:08:28,415 --> 00:08:29,183 Grounded 165 00:08:29,695 --> 00:08:34,303 And that's a bully and you guys my right bullions alright true false true false 166 00:08:34,559 --> 00:08:37,375 True false in credit all kinds of primers 167 00:08:37,887 --> 00:08:43,519 Guys be honest a perimeter is just a variable that's what it is it's just basically of variable 168 00:08:43,775 --> 00:08:46,335 Associated with your animator ok 169 00:08:46,847 --> 00:08:47,615 So I have 170 00:08:48,127 --> 00:08:50,175 A variable called grounded 171 00:08:50,431 --> 00:08:52,479 What is actually does this even mean 172 00:08:52,735 --> 00:08:56,319 I know I already have a variable called grounded inside of player 173 00:08:56,831 --> 00:08:58,367 The actual script 174 00:08:58,623 --> 00:09:00,415 Meaning when he's on the ground 175 00:09:00,671 --> 00:09:01,951 Grounded is set to true 176 00:09:02,719 --> 00:09:05,535 Well I can actually send that information 177 00:09:05,791 --> 00:09:07,327 Into the animator 178 00:09:08,351 --> 00:09:11,167 And then tell the animator to 179 00:09:11,423 --> 00:09:13,215 Play the jump animation 180 00:09:13,727 --> 00:09:17,055 Based on if the player is no longer grounded again 181 00:09:17,311 --> 00:09:18,847 Grounded equals Fosse 182 00:09:19,103 --> 00:09:19,615 Ok 183 00:09:20,639 --> 00:09:26,783 How many create a tonne of different parameters here in the slowly start using them 184 00:09:27,039 --> 00:09:29,087 And make animation changes 185 00:09:29,599 --> 00:09:35,743 Based on whether a promoter is true or false or whether a velocity value is bigger than 0 or 186 00:09:36,767 --> 00:09:39,071 What's go ahead in create a few variables 187 00:09:39,327 --> 00:09:44,191 Because I know that this is confusing this is one of the things that really confused me when I was learning unity 188 00:09:44,447 --> 00:09:45,215 Don't panic 189 00:09:45,471 --> 00:09:46,751 I know you might feel a little bit 190 00:09:47,007 --> 00:09:48,287 Lasted right now but 191 00:09:48,543 --> 00:09:49,823 Go along with me 192 00:09:50,335 --> 00:09:51,871 Ms Crazies parameters 193 00:09:53,407 --> 00:09:55,455 We're going to first create a float 194 00:09:55,967 --> 00:09:57,503 IKEA creator 195 00:09:58,271 --> 00:10:01,100 Vector to I don't know why but we can't create a vector 2 196 00:10:01,101 --> 00:10:03,273 Subtitled by -♪ online-courses.club ♪- We compress knowledge for you! https://t.me/joinchat/ailxpXoW3JVjYzQ1 197 00:10:03,274 --> 00:10:04,927 As a parameter but we can create velocity 198 00:10:05,183 --> 00:10:05,695 X 199 00:10:06,463 --> 00:10:08,511 Any we can also create velocity 200 00:10:09,535 --> 00:10:10,303 Why 201 00:10:10,815 --> 00:10:12,607 No why do we need these values 202 00:10:12,863 --> 00:10:18,495 Because we want to send information from the player script into this animator component 203 00:10:19,007 --> 00:10:20,031 This controller 204 00:10:20,287 --> 00:10:23,871 And say hey the velocity of the player is 1 205 00:10:24,127 --> 00:10:25,151 Let's play 206 00:10:25,407 --> 00:10:26,943 What the running animation 207 00:10:27,199 --> 00:10:29,247 Because well the velocity is 1 208 00:10:30,271 --> 00:10:35,647 Or if the velocity is back down to 0 animation to be player stand 209 00:10:36,159 --> 00:10:37,439 Instead of player run 210 00:10:38,463 --> 00:10:43,583 So there is two variables we're gonna use we're gonna create another one we're going to call this a Trigger 211 00:10:44,095 --> 00:10:45,375 And it's going to attack 212 00:10:45,631 --> 00:10:51,775 A trigger is a lot different than a billion a bullying can remain true or remain false 213 00:10:52,031 --> 00:10:56,127 Said it said I trigger just happens once like firing a gun 214 00:10:57,407 --> 00:10:59,199 So if I say hey 215 00:10:59,711 --> 00:11:01,247 Animator attack 216 00:11:01,503 --> 00:11:02,783 If we're going to go 217 00:11:05,599 --> 00:11:07,903 As opposed to UK animator grounded 218 00:11:08,159 --> 00:11:10,207 Can be true until I tell her to be false 219 00:11:10,463 --> 00:11:12,511 Alright we got grounded velocity 220 00:11:12,767 --> 00:11:14,559 X why we get attacked 221 00:11:15,071 --> 00:11:17,375 We can also create a hurt 222 00:11:17,631 --> 00:11:18,399 Trigger 223 00:11:20,447 --> 00:11:22,495 We can also create a jump Trigger 224 00:11:23,007 --> 00:11:26,591 And when we create a few more here what about move Direction 225 00:11:27,103 --> 00:11:27,871 As an integer 226 00:11:28,383 --> 00:11:30,175 Not a float but just an integer 227 00:11:30,431 --> 00:11:35,295 We create another one baby for future versions of this game may be attacked directions 228 00:11:35,551 --> 00:11:40,415 If I punching down it'll be one animation if you're punching to the right it'll be another animation 229 00:11:40,671 --> 00:11:44,511 And that's going to be integer and we can call it a tag 230 00:11:44,767 --> 00:11:50,143 Directions get more specific attack Direction why so we punching up vs punching down 231 00:11:50,399 --> 00:11:51,679 If you're not doing either 232 00:11:52,447 --> 00:11:53,983 Then one is going to party left or right 233 00:11:54,239 --> 00:11:55,519 Based on the move Direction 234 00:11:55,775 --> 00:11:58,591 Ok let's see another trigger we could create 235 00:11:59,103 --> 00:12:03,711 Is Flash meaning if the player is hurt or they collect health 236 00:12:03,967 --> 00:12:09,087 We're going to play the flash animation so once that fires is going to immediately go to the flash animation 237 00:12:10,111 --> 00:12:12,415 Again guys I know this is confusing just bear with me 238 00:12:12,671 --> 00:12:14,975 So these are all of the parameters 239 00:12:15,231 --> 00:12:18,559 Aka variables associated with this animator 240 00:12:19,071 --> 00:12:20,351 Associate with the player 241 00:12:20,607 --> 00:12:26,751 Am I going to use these to determine which animation plays guys we don't have parameters it's going to be 242 00:12:27,007 --> 00:12:29,311 It's hard to know which animation to play 243 00:12:29,823 --> 00:12:33,151 So again if we know that the players grounded is true 244 00:12:33,663 --> 00:12:35,199 Then we can send 245 00:12:35,455 --> 00:12:40,575 The animated to a new animation which is the standard information is grounded is false 246 00:12:40,831 --> 00:12:43,135 It's going to send it to the jump in a mission 247 00:12:44,671 --> 00:12:46,207 Well if we go ahead in 248 00:12:46,463 --> 00:12:48,255 Hit seen and then hit play 249 00:12:48,767 --> 00:12:50,559 I can show you what's going on here 250 00:12:52,607 --> 00:12:56,447 What's jumping over these guys in stay and about right here 251 00:12:56,703 --> 00:12:58,751 What's lighter animator window here 252 00:12:59,007 --> 00:13:01,055 N n select our player 253 00:13:02,079 --> 00:13:02,847 To take a look 254 00:13:03,359 --> 00:13:05,663 Is there a blue Bar is indicating 255 00:13:06,175 --> 00:13:10,271 The player is in the stand innovation and it just simply lupin right 256 00:13:11,039 --> 00:13:17,183 We've also got all other parameters here but you can see they're all just sort of it though default value that's because 257 00:13:17,439 --> 00:13:21,023 What have any script telling these parameters what to be 258 00:13:21,279 --> 00:13:24,863 We don't know where the ground is true or false we don't know what the velocity is 259 00:13:25,119 --> 00:13:30,239 These are not linked in any way to the variables associated with the players 260 00:13:30,751 --> 00:13:32,799 And that is the new player script 261 00:13:33,055 --> 00:13:35,359 They're just not associated in any way 262 00:13:35,871 --> 00:13:37,663 We need to make them associate 263 00:13:37,919 --> 00:13:40,991 So let's jump into a new player script in make that happen 264 00:13:41,247 --> 00:13:43,295 When you go home double click on new player here 265 00:13:44,319 --> 00:13:46,367 Are we going to open that up in Visual Studio 266 00:13:47,135 --> 00:13:53,023 In the very first thing we need is a reference to the animator remember guys everything is pretty much 267 00:13:53,279 --> 00:13:56,863 You know I can Pony that even NM are a component 268 00:13:57,119 --> 00:13:58,143 On your player 269 00:13:58,655 --> 00:14:02,239 For example if we open up on Unity Project and take a look at the player 270 00:14:02,495 --> 00:14:05,055 We can see we have this animatorcontroller here 271 00:14:05,311 --> 00:14:09,919 That's what they say is right when we look at this is basically just digging deep inside of this 272 00:14:10,175 --> 00:14:16,319 Well we need a reference to that that's open up a script and what we're going to do is just create a new reference 273 00:14:16,575 --> 00:14:18,111 A references section here 274 00:14:18,623 --> 00:14:21,439 Remember we're going to be doing in alphabetical order 275 00:14:21,695 --> 00:14:24,767 So we can put it right here it's going to be serialised 276 00:14:25,023 --> 00:14:26,559 And it's going to be private 277 00:14:28,095 --> 00:14:33,215 Going to be an animator component in this is call it in a metre with a lowercase a 278 00:14:33,983 --> 00:14:36,287 Alright that's going to be a reference for the animator 279 00:14:36,799 --> 00:14:42,943 And then we're going to do is we're going to go down to the bottom of her update and I'm going to create a new calm and I'm going to call this 280 00:14:43,199 --> 00:14:45,759 Set each animator float 281 00:14:46,783 --> 00:14:47,551 And Trigger 282 00:14:48,063 --> 00:14:48,575 To it 283 00:14:50,623 --> 00:14:54,719 So it knows which animation to fire 284 00:14:55,743 --> 00:14:58,815 We're going to say a animator set float 285 00:14:59,839 --> 00:15:00,607 Velocity 286 00:15:02,399 --> 00:15:03,679 Eczema that promote 287 00:15:04,447 --> 00:15:05,727 We're going to setup flow 288 00:15:06,495 --> 00:15:07,007 2 289 00:15:07,775 --> 00:15:10,847 The absolute value so mad after apps 290 00:15:12,639 --> 00:15:16,479 The city of the player working in / at the max speed 291 00:15:16,991 --> 00:15:22,111 So what this means guys is basically we're going to set the perimeter velocity x 292 00:15:22,367 --> 00:15:24,415 Of the animator on the player 293 00:15:24,671 --> 00:15:26,207 We're going to set that value 294 00:15:26,463 --> 00:15:30,303 To the absolute value of a current explore City 295 00:15:30,559 --> 00:15:32,351 Which would be something like it 296 00:15:32,607 --> 00:15:38,751 You know -5 the absolute value would be 5 right as I was going to go to the positive number and then we're going to do 297 00:15:39,007 --> 00:15:43,359 Buy a max speed so can be point 10.4 298 00:15:43,615 --> 00:15:46,175 Or all the way up to a maximum value of 1 299 00:15:46,687 --> 00:15:48,223 It's never going to be negative 300 00:15:48,479 --> 00:15:48,991 Right 301 00:15:49,247 --> 00:15:53,855 This allows us to basically say is the player moving or not 302 00:15:54,111 --> 00:15:58,719 Is there a value greater than zero or not this also 303 00:15:58,975 --> 00:16:01,279 Arrange between 0 and 1 304 00:16:01,535 --> 00:16:04,095 I'm Gonna Save The Script then I'm going to go back into unity 305 00:16:04,351 --> 00:16:06,655 And let's go ahead in hip play 306 00:16:06,911 --> 00:16:13,055 So if we go ahead and Dragon animator tab over here so that we can see it while we're playing the game 307 00:16:13,311 --> 00:16:16,895 Kindle the crowded you can see that if we click on our parameters here 308 00:16:18,431 --> 00:16:20,479 The value is not being updated 309 00:16:20,735 --> 00:16:21,503 Why is that 310 00:16:21,759 --> 00:16:27,647 Because we haven't actually provided a reference so let's be sure to provide a reference so go to our player here 311 00:16:27,903 --> 00:16:33,279 Got a new player and we're going to drag her animator component into that animator variable 312 00:16:33,535 --> 00:16:34,303 That we created 313 00:16:34,815 --> 00:16:36,095 Alright now it's Hitler 314 00:16:36,607 --> 00:16:38,911 Ok so velocity is currently is 0 315 00:16:39,423 --> 00:16:40,703 But as we ran look at that 316 00:16:42,239 --> 00:16:44,287 It's slowly increasing in value 317 00:16:45,567 --> 00:16:46,847 Based on our speed 318 00:16:47,359 --> 00:16:52,223 The absolute value of a speed so doesn't matter whether I'm going left or right and also 319 00:16:52,735 --> 00:16:58,879 It's been / the max speeds that means we're always going to basically get a percentage right and that's what this is 320 00:16:59,135 --> 00:17:00,415 So if you are going to be 321 00:17:00,927 --> 00:17:01,439 You know 322 00:17:01,695 --> 00:17:03,999 In-between wanna a maximum of 1 323 00:17:04,255 --> 00:17:06,047 Or when we stop 0 324 00:17:06,559 --> 00:17:07,839 So hopefully that makes sense 325 00:17:08,095 --> 00:17:11,167 Does this velocity x cannot change 326 00:17:11,423 --> 00:17:12,959 The velocity of the player 327 00:17:13,215 --> 00:17:14,751 Rather is reverse right 328 00:17:15,007 --> 00:17:21,151 Has the players velocity changes all this does is basically inform us in it informs unit 329 00:17:21,407 --> 00:17:22,431 Animator window 330 00:17:23,455 --> 00:17:24,991 How fast do players going 331 00:17:25,247 --> 00:17:27,039 Relative to the maximum speed 332 00:17:27,807 --> 00:17:32,159 So let's go ahead and your back into her new player script I must go ahead and 333 00:17:32,415 --> 00:17:34,719 Some other values for animator 334 00:17:35,231 --> 00:17:39,839 So animator set float in guys whenever we do this sort of set 335 00:17:40,351 --> 00:17:44,191 Function here it's just a specific function associated 336 00:17:44,447 --> 00:17:46,751 With the animator component 337 00:17:47,007 --> 00:17:48,031 Velocity 338 00:17:49,823 --> 00:17:50,335 Why 339 00:17:50,847 --> 00:17:51,871 Anyway 340 00:17:52,127 --> 00:17:52,895 Said that 341 00:17:53,663 --> 00:17:54,943 To the velocity 342 00:17:55,711 --> 00:17:56,479 That's why 343 00:17:57,759 --> 00:18:03,903 We don't need any real unique function here when I go to use an absolute value or anything like that alright those are the 344 00:18:04,159 --> 00:18:08,511 Play two that I really need right now to determine if the players running or jumping 345 00:18:08,767 --> 00:18:10,303 Samina save this out 346 00:18:11,071 --> 00:18:12,607 How many jump back in the universe 347 00:18:13,631 --> 00:18:15,423 What's go ahead in select or player 348 00:18:16,191 --> 00:18:17,727 Can you get a create a new clip 349 00:18:18,239 --> 00:18:20,031 And we're going to call this player 350 00:18:20,799 --> 00:18:23,871 Ryan in Wigan make sure it's in our player animation folder 351 00:18:25,151 --> 00:18:25,663 Click 352 00:18:25,919 --> 00:18:26,687 Ok 353 00:18:27,199 --> 00:18:28,479 Then click the record 354 00:18:28,991 --> 00:18:30,783 Lol I'm going to do 355 00:18:31,807 --> 00:18:33,087 I'm going to do for this 356 00:18:33,343 --> 00:18:34,367 Is making 357 00:18:34,879 --> 00:18:38,719 Have a very simplistic run stands so something like this 358 00:18:38,975 --> 00:18:39,487 Ok 359 00:18:39,743 --> 00:18:41,279 What is arms are a little bit 360 00:18:43,071 --> 00:18:43,583 My bag 361 00:18:45,119 --> 00:18:46,911 And what I'm going to do 362 00:18:47,935 --> 00:18:51,263 Is a naggin a worry about the actual animation 363 00:18:51,775 --> 00:18:57,407 I'm actually going to worry about the bounce I want it to look bouncy ok I mean it's like his pelvis 364 00:18:58,431 --> 00:18:59,967 I mean it's like the move tool 365 00:19:00,735 --> 00:19:03,039 And then I'm gonna put him down to that right here 366 00:19:04,063 --> 00:19:05,599 And let's see 367 00:19:06,623 --> 00:19:07,647 About here 368 00:19:08,415 --> 00:19:09,695 Remove app like this 369 00:19:10,463 --> 00:19:12,255 Anyway going to copy and paste 370 00:19:13,535 --> 00:19:14,815 The first keyframes 371 00:19:15,071 --> 00:19:15,839 Tapir 372 00:19:17,631 --> 00:19:18,911 Alright looks good 373 00:19:20,191 --> 00:19:21,215 Something like that 374 00:19:21,471 --> 00:19:27,615 Ok so I can see a camel so he's on a rubber band is actually bouncing right 375 00:19:27,871 --> 00:19:29,151 The way that we solve that 376 00:19:29,407 --> 00:19:31,967 Is we can actually go to are curves here 377 00:19:32,223 --> 00:19:32,735 Ok 378 00:19:33,247 --> 00:19:37,855 And using this tool over here we can really zoom in your curves 379 00:19:39,135 --> 00:19:40,159 Ok let's see if we 380 00:19:40,415 --> 00:19:41,439 There we go 381 00:19:42,207 --> 00:19:43,743 Resume into a curves 382 00:19:44,767 --> 00:19:45,791 Just like that 383 00:19:46,047 --> 00:19:49,119 You can seem to get a very smooth graph to it 384 00:19:49,375 --> 00:19:51,679 If I make this like this 385 00:19:52,191 --> 00:19:53,215 And like that 386 00:19:54,239 --> 00:19:54,751 Now 387 00:19:55,263 --> 00:19:57,055 He also his dancing see that 388 00:19:58,591 --> 00:20:03,455 Does no longer smooth when he hit the ground if you had a jump in your fever to hit the ground 389 00:20:03,967 --> 00:20:05,759 They would stop immediately 390 00:20:06,015 --> 00:20:07,295 Can you dance again 391 00:20:07,551 --> 00:20:09,855 I need smoothly go into the air 392 00:20:10,111 --> 00:20:13,439 So messing with these curves really requires a lot of practise guide 393 00:20:13,695 --> 00:20:18,559 And I know it might look confusing but we're going to be using these a lot so just follow along as best as you can 394 00:20:18,815 --> 00:20:23,423 So that is going to be a run animation for now right that's about all we need 395 00:20:23,679 --> 00:20:27,007 And we also have the stand animation like this see that 396 00:20:27,775 --> 00:20:33,919 Ok so we're going to go back to your animator window zoom in a little bit here in now you can see that 397 00:20:34,175 --> 00:20:40,319 As we created another animation we have this player run animation and it's a hanging out in the Aether right 398 00:20:40,575 --> 00:20:42,623 Unity doesn't really know what to do with 399 00:20:43,391 --> 00:20:46,719 Well we need to tell unity when to play this animation 400 00:20:46,975 --> 00:20:47,743 Cell 401 00:20:47,999 --> 00:20:51,583 The way that we do that is we can actually right click and play Stand 402 00:20:52,095 --> 00:20:53,631 Click make transition 403 00:20:55,167 --> 00:20:57,471 And now we going to drag this little arrow 404 00:20:57,727 --> 00:20:58,751 To play Run 405 00:21:00,543 --> 00:21:04,127 Here we go and you can move it around whenever you want it doesn't matter where they are 406 00:21:04,383 --> 00:21:05,663 How do you say to stay organised 407 00:21:06,943 --> 00:21:08,479 What does mean is that 408 00:21:08,735 --> 00:21:10,783 Play wrist and is going to move 409 00:21:11,295 --> 00:21:12,319 To play Run 410 00:21:13,087 --> 00:21:13,855 After 411 00:21:14,111 --> 00:21:15,391 We finished the animation 412 00:21:16,416 --> 00:21:22,048 Well the first thing you want to do is double click and play around in over here you're going to see the inspector 413 00:21:22,304 --> 00:21:24,608 Of the player Ryan animation 414 00:21:24,864 --> 00:21:29,984 Looks like everything is set up properly all I was really worried about here was the loop time 415 00:21:30,240 --> 00:21:34,336 All this means is that it's going to loop right and we definitely want to run a mission 416 00:21:34,592 --> 00:21:35,360 The loop 417 00:21:36,128 --> 00:21:39,712 Ok next what we want to do is select this transition here 418 00:21:41,504 --> 00:21:45,856 Take a look at this weird inspector over this is very hard 419 00:21:46,880 --> 00:21:53,024 Well you can actually spend a lot of time over here so try and understand as best as you can get to using this 420 00:21:53,792 --> 00:21:55,584 So the first thing 421 00:21:55,840 --> 00:21:59,424 That you're going to want to look at his this has exit time 422 00:22:00,192 --> 00:22:01,472 All this means is 423 00:22:01,728 --> 00:22:04,032 Do you want to wait 424 00:22:05,056 --> 00:22:07,616 Put the playlist and animation to play Once 425 00:22:08,128 --> 00:22:08,896 Before 426 00:22:09,408 --> 00:22:14,016 Exiting the animation and moving to the player run animation 427 00:22:15,296 --> 00:22:18,112 How much was go ahead in see what happens here 428 00:22:18,624 --> 00:22:22,464 From what I can gather we're gonna play the playlist animation 429 00:22:22,720 --> 00:22:26,048 And then we're going to transition to you the player run animation 430 00:22:26,304 --> 00:22:27,584 So we have the entry 431 00:22:27,840 --> 00:22:28,864 So when we hit play 432 00:22:29,120 --> 00:22:31,168 Move the playlist and play Once 433 00:22:31,424 --> 00:22:32,704 And I moved to play around 434 00:22:33,472 --> 00:22:35,008 Please take a look and see what happens 435 00:22:39,360 --> 00:22:40,128 There we go 436 00:22:42,944 --> 00:22:44,224 So again will take a look 437 00:22:47,552 --> 00:22:52,672 It plays the player staying in motion and then immediately transitions to the play Run animation 438 00:22:52,928 --> 00:22:56,000 Well we definitely don't want that right cos he's staying in place 439 00:22:56,512 --> 00:22:59,584 How do we tell unity to only play it 440 00:23:00,352 --> 00:23:01,120 When I'm running 441 00:23:01,632 --> 00:23:03,424 Well that's where the prime is coming 442 00:23:04,192 --> 00:23:10,336 Because we now have this velocity explain matter we can create an if statement without even writing any scriptwriter 443 00:23:10,592 --> 00:23:12,128 Use this little transition here 444 00:23:12,384 --> 00:23:14,176 To determine when we should run 445 00:23:14,432 --> 00:23:16,480 I'm going to select this transition here 446 00:23:17,760 --> 00:23:19,296 Can I get a create a new condition 447 00:23:19,808 --> 00:23:21,088 Ennis inspector field 448 00:23:22,880 --> 00:23:26,208 We can't click the dropdown menu in look at all about parameters 449 00:23:26,464 --> 00:23:27,744 So if velocity 450 00:23:29,536 --> 00:23:32,352 Is greater than what's a point 451 00:23:32,864 --> 00:23:33,376 1 452 00:23:33,632 --> 00:23:35,680 Then it's going to play 453 00:23:36,192 --> 00:23:37,984 The player run animation 454 00:23:38,240 --> 00:23:38,752 Ok 455 00:23:40,800 --> 00:23:43,104 Click play and see what happens 456 00:23:49,248 --> 00:23:50,016 Derry girls 457 00:23:52,320 --> 00:23:53,344 But now he's stuck 458 00:23:54,368 --> 00:23:59,232 Why is he stuck now he's just still playing the run animation 459 00:23:59,744 --> 00:24:01,024 That's because 460 00:24:01,536 --> 00:24:06,912 Look there's no arrow telling you need to go back to the playlist and inhibition rate 461 00:24:07,424 --> 00:24:08,704 Select this 462 00:24:08,960 --> 00:24:09,472 Radcliffe 463 00:24:09,984 --> 00:24:11,264 Quick make transition 464 00:24:12,800 --> 00:24:14,080 And there we go 465 00:24:15,104 --> 00:24:16,896 It's going to play the player animation 466 00:24:17,152 --> 00:24:18,944 Ennis going to go back to PlayStation 467 00:24:19,712 --> 00:24:24,064 Search for how to make a Windows a little bit bigger here so you guys can see 468 00:24:24,576 --> 00:24:26,112 Get a little bit complicated here 469 00:24:27,648 --> 00:24:28,416 Alright 470 00:24:29,696 --> 00:24:31,488 So let's see how to make this 471 00:24:32,000 --> 00:24:33,792 1920 by 1080 that looks good 472 00:24:34,560 --> 00:24:37,376 And let's select a player and play 473 00:24:37,632 --> 00:24:39,680 So I'm running 474 00:24:40,192 --> 00:24:41,216 There we go 475 00:24:41,472 --> 00:24:45,568 Almost there we go but I did see 476 00:24:45,824 --> 00:24:48,896 It only plays once and then it goes back to play a stand 477 00:24:49,152 --> 00:24:51,712 And we have to wait for that information to complete 478 00:24:51,968 --> 00:24:53,760 Before even giving us a chance 479 00:24:54,016 --> 00:24:56,064 To play that player run in a nation again 480 00:24:56,576 --> 00:24:58,624 And this has to do with 481 00:24:59,136 --> 00:25:03,488 Exit time ok so we can actually select these transitions here 482 00:25:04,256 --> 00:25:06,816 Until the animator controller 483 00:25:07,328 --> 00:25:08,352 Whether or not 484 00:25:08,864 --> 00:25:11,680 You want to wait for animation to complete 485 00:25:11,936 --> 00:25:14,240 Before moving to the next animation 486 00:25:14,752 --> 00:25:16,032 That's really what the time is 487 00:25:16,288 --> 00:25:20,640 Exit I'm means wait for the animation to complete before you even check 488 00:25:20,896 --> 00:25:21,664 The condition 489 00:25:22,176 --> 00:25:25,248 Where can I sell it right if I press the right or left 490 00:25:25,760 --> 00:25:28,064 I really want to immediately go 491 00:25:28,832 --> 00:25:31,904 To the player run animation so many diesel like that 492 00:25:32,160 --> 00:25:33,184 But not transition 493 00:25:34,208 --> 00:25:36,256 Parsley the same as true here as well 494 00:25:36,768 --> 00:25:37,536 I don't want to 495 00:25:37,792 --> 00:25:42,400 Have the player run animation complete before transitioning to play a stand 496 00:25:43,168 --> 00:25:44,960 Tell me the disable exit time as well 497 00:25:45,728 --> 00:25:49,056 You may wonder when you'd wanna use an exit time 498 00:25:49,312 --> 00:25:55,200 Well what if you wanted to limit the players Billy the shoot a gun until they reload right 499 00:25:55,456 --> 00:25:59,040 Well you have a reload animation you would require the exit time 500 00:25:59,296 --> 00:26:01,600 Before they can put it back out in begin to shoot 501 00:26:02,368 --> 00:26:04,672 Saturday play here and see how it looks 502 00:26:12,864 --> 00:26:15,424 Why is it Glitchy you see that 503 00:26:15,680 --> 00:26:16,704 It's not a stuck 504 00:26:17,472 --> 00:26:20,544 Oh I see you finally sleep before me 505 00:26:21,312 --> 00:26:27,456 If we look over in our actual inspector over here you see all the area here what is that Alexa playing 506 00:26:27,712 --> 00:26:28,224 Take a look 507 00:26:29,504 --> 00:26:32,832 If we select the transition from player run to player stand 508 00:26:33,088 --> 00:26:34,112 You can see that it says 509 00:26:34,368 --> 00:26:36,928 Transition needs at least one condition 510 00:26:37,184 --> 00:26:38,464 Or an exit time 511 00:26:38,720 --> 00:26:39,488 To be valid 512 00:26:39,744 --> 00:26:41,536 Otherwise it's going to be ignored 513 00:26:42,048 --> 00:26:46,656 So because we set exit time to force he doesn't know what to do now 514 00:26:46,912 --> 00:26:48,192 So we need to add condition 515 00:26:48,448 --> 00:26:49,984 What is that condition well 516 00:26:50,752 --> 00:26:52,032 Velocity x 517 00:26:52,288 --> 00:26:55,360 Is less than what was it .1 518 00:26:55,872 --> 00:26:58,176 This one is greater than .1 519 00:26:58,432 --> 00:27:00,480 Airport if it gets smaller than .1 520 00:27:00,992 --> 00:27:03,040 When is going to go back to player stand 521 00:27:04,320 --> 00:27:06,368 Alright let's take a look and see if this works 522 00:27:12,256 --> 00:27:12,768 Great 523 00:27:15,072 --> 00:27:15,584 What 524 00:27:16,864 --> 00:27:21,728 So obviously the jumping is just horrible but 525 00:27:22,752 --> 00:27:23,520 The running 526 00:27:23,776 --> 00:27:24,800 Is working perfectly 527 00:27:27,360 --> 00:27:31,712 Now if you don't want it to be that slow not to tell the transition 528 00:27:31,968 --> 00:27:32,736 Between 529 00:27:33,248 --> 00:27:38,880 Running in standings is can a slow write his hands go back to position a little too late 530 00:27:39,392 --> 00:27:42,464 Well what you could do is actually say ok 531 00:27:42,720 --> 00:27:46,560 I'm going to a transitions here and take a look here 532 00:27:47,328 --> 00:27:48,608 Well we could make the 533 00:27:49,888 --> 00:27:54,496 We open up our settings here we could actually make the transition Direction really fast right we can do 534 00:27:55,008 --> 00:27:57,824 0.05 for both transitions 535 00:28:00,640 --> 00:28:01,920 Say that out 536 00:28:02,176 --> 00:28:02,688 Take a look 537 00:28:03,456 --> 00:28:03,968 Yeah 538 00:28:04,224 --> 00:28:06,016 Feels a little bit more snappy I like that 539 00:28:07,808 --> 00:28:10,112 But you never stop even when I stop it keeps playing 540 00:28:10,368 --> 00:28:16,512 So maybe what we can do is let's see here it's good game player and then go to Wellingborough train station 541 00:28:17,280 --> 00:28:23,424 We can make velocity the required velocity to begin running something a little bit bigger right we can do point 542 00:28:23,680 --> 00:28:24,192 3 543 00:28:24,448 --> 00:28:29,056 And if it gets smaller than .3 so when he starts to slow down 544 00:28:29,312 --> 00:28:31,872 Km Lee go back to a standing position 545 00:28:32,128 --> 00:28:32,896 Does Google work 546 00:28:36,736 --> 00:28:38,016 That feels a lot better 547 00:28:38,784 --> 00:28:39,296 Ok 548 00:28:41,344 --> 00:28:42,368 Perfect 549 00:28:44,160 --> 00:28:44,672 Ok 550 00:28:45,440 --> 00:28:51,584 So obviously the running animation is not complete we can obviously tweet that as much as we want have his legs move his arms 551 00:28:51,840 --> 00:28:54,912 But for now when I want to do is get the jump 552 00:28:55,168 --> 00:28:57,216 What's take a look at our parameters willy 553 00:28:57,472 --> 00:29:00,800 When I jump look at the lottery if it's greater than 0 554 00:29:01,312 --> 00:29:02,848 That means were jumping right 555 00:29:03,360 --> 00:29:05,664 If it's less than 0 amines were falling 556 00:29:06,432 --> 00:29:09,504 So I think we can actually create two animations guys 557 00:29:09,760 --> 00:29:13,344 Would you have a jump animation and then we can have a full animation 558 00:29:13,600 --> 00:29:15,648 In blend between the two 559 00:29:16,160 --> 00:29:18,976 As he's going up and then going down 560 00:29:19,232 --> 00:29:21,792 Super example if I'm jumping right now we would 561 00:29:22,560 --> 00:29:28,704 Do a jump animation and then a fall animation jump animation fall in the mission jump animation 562 00:29:28,960 --> 00:29:30,240 Animation 563 00:29:30,496 --> 00:29:31,264 Search bar of here 564 00:29:32,032 --> 00:29:34,592 Just a full animation right no jumping just ball 565 00:29:36,384 --> 00:29:42,528 Alright so let's go ahead and those two animations 42894

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