All language subtitles for 5. Camera move control

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
ceb Cebuano
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
hmn Hmong
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
lb Luxembourgish
mk Macedonian
mg Malagasy
ms Malay
ml Malayalam
mt Maltese
mi Maori
mr Marathi
mfe Mauritian Creole
mo Moldavian
mn Mongolian
my Myanmar (Burmese)
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 Portuguese (Portugal)
pa Punjabi
qu Quechua
ro Romanian
rm Romansh
nyn Runyakitara
ru Russian Download
sm Samoan
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:03,750 --> 00:00:07,830 So now we're going to work on our first script and we're going to get our camera to start moving. 2 00:00:08,100 --> 00:00:12,300 This is one of the reasons why we imported a package called Joystick Pack. 3 00:00:12,760 --> 00:00:17,920 OK, so for DoubleClick and Joystick Pack does have some documentation which you are free to read to 4 00:00:18,180 --> 00:00:19,470 explain to us to use this. 5 00:00:19,890 --> 00:00:21,570 We do have a number of prefabs. 6 00:00:21,750 --> 00:00:25,620 OK, so the one that we want to go with is a fixed joystick. 7 00:00:25,920 --> 00:00:31,200 The difference between these dynamic joystick will appear wherever you press your finger floatin joystick 8 00:00:31,200 --> 00:00:32,990 can float anywhere as well. 9 00:00:33,000 --> 00:00:35,550 And the variable joystick obviously is variable. 10 00:00:35,580 --> 00:00:41,580 You can change those items fixed will always stay in the same position, or at least that's as far. 11 00:00:41,610 --> 00:00:44,460 That's what I understood when I read the documentation. 12 00:00:45,120 --> 00:00:51,150 So in order to work with a fixed joystick, we need it to be a UI element or a user interface. 13 00:00:51,570 --> 00:00:54,570 All of your UI elements are going to fit on the canvas. 14 00:00:54,810 --> 00:00:56,400 So we need to create ourselves a canvas. 15 00:00:56,950 --> 00:01:01,110 So let's click game object UI and then you canvas. 16 00:01:01,650 --> 00:01:04,500 As soon as you do that, you get cumbersome to event system. 17 00:01:05,190 --> 00:01:12,480 The event system is basically what is going to detect your touchin of the items and interacting with 18 00:01:12,480 --> 00:01:16,710 those elements using the standalone input module. 19 00:01:17,260 --> 00:01:22,860 OK, if you ever wanted to switch on the view UI elements of just basically uncheck that you can no 20 00:01:22,860 --> 00:01:24,990 longer interact with your canvas. 21 00:01:25,730 --> 00:01:30,920 OK, well, I'm quite happy to do so and so canvas. 22 00:01:30,930 --> 00:01:36,750 The first thing that we notice about it is that the randomly is screen space overlay. 23 00:01:36,930 --> 00:01:40,650 So that basically means it will always be exactly the same and render over everything. 24 00:01:42,570 --> 00:01:47,460 If you did change that to screen space camera basically means it's only available on certain camera. 25 00:01:48,180 --> 00:01:53,790 So you could switch cameras in the UI and disappear or worldspace means you could actually have a canvas 26 00:01:53,790 --> 00:01:56,640 inside of the world that takes on the 3D location. 27 00:01:57,660 --> 00:01:58,350 That's useful. 28 00:01:58,360 --> 00:02:05,040 For example, if you wanted like a health bar over your characters, work in the to stick with screen 29 00:02:05,040 --> 00:02:09,900 space overlay and targets play. 30 00:02:10,080 --> 00:02:11,490 Always make sure it's display one. 31 00:02:11,670 --> 00:02:14,700 That's what we're using up here if we want to display, too. 32 00:02:14,730 --> 00:02:16,670 That's what we show in 3D. 33 00:02:16,680 --> 00:02:18,330 It's literally nothing rendering there. 34 00:02:18,570 --> 00:02:20,550 So let's make sure it stays on display. 35 00:02:20,560 --> 00:02:23,100 One additional shaded channels. 36 00:02:23,400 --> 00:02:23,700 Yeah. 37 00:02:23,790 --> 00:02:24,290 Just leave it. 38 00:02:24,310 --> 00:02:24,720 Nothing. 39 00:02:25,530 --> 00:02:30,810 Now, very importantly, I kambah scalar at the moment, UI scale mode is constant pixel size. 40 00:02:31,440 --> 00:02:38,380 So even though this is 12, Racheli, 720, if we create a UI and get it all lined up and then somebody 41 00:02:38,380 --> 00:02:44,550 has got a mobile device that's capable of running a full three thousand eight hundred and sixty pixels. 42 00:02:44,950 --> 00:02:49,020 And what's going to happen is UUA is going to be absolutely tiny. 43 00:02:49,140 --> 00:02:49,440 Right. 44 00:02:49,770 --> 00:02:51,750 So small, you're not being able to interact with it. 45 00:02:52,560 --> 00:02:56,280 So I'm going to change this to scale with screen size. 46 00:02:56,940 --> 00:03:02,880 And I'm going to use our dimensions as a default reference resolution. 47 00:03:03,690 --> 00:03:06,030 So 12, 18 by 720. 48 00:03:07,260 --> 00:03:09,000 So that's where it's going to start out with. 49 00:03:09,060 --> 00:03:12,600 Now, if somebody's screen is way bigger than that, what he's going to do, it's actually going to 50 00:03:12,600 --> 00:03:13,980 scale up this UI. 51 00:03:14,130 --> 00:03:16,380 So it fits the screen size. 52 00:03:16,770 --> 00:03:20,940 Or for some reason, if somebody has got like a really little mobile device, he's going to actually 53 00:03:20,940 --> 00:03:22,620 scale down as well. 54 00:03:23,670 --> 00:03:27,000 Now, on the mobile devices, we do want a much width or height. 55 00:03:28,290 --> 00:03:32,490 And we probably want to match the height actually on this one. 56 00:03:33,430 --> 00:03:39,450 And and our reference pixels per unit, it's about 100, which is fine graphics. 57 00:03:39,450 --> 00:03:43,560 Recasner basically means that we can actually touch things on the canvas. 58 00:03:43,800 --> 00:03:44,250 All right. 59 00:03:46,020 --> 00:03:51,630 And so what we're now going to do is we're going to take a fixed joystick, click and drag onto the 60 00:03:51,630 --> 00:03:53,400 canvas, and then we go, all right. 61 00:03:53,520 --> 00:03:54,210 Now, got this. 62 00:03:54,720 --> 00:03:59,100 And we can move this around in 3D space by using a pulse X, pulse y. 63 00:04:00,030 --> 00:04:06,120 So I'm just going to kind of click and drag over to the left hand side, click and drag down into the 64 00:04:06,120 --> 00:04:07,170 bottom left hand corner. 65 00:04:08,250 --> 00:04:14,670 Now, what I would recommend doing at this moment in time is going over to your simulator, rotate it 66 00:04:14,760 --> 00:04:19,260 loops like this, making sure it looks OK on the screen. 67 00:04:19,530 --> 00:04:21,270 This is what it currently will look like. 68 00:04:22,660 --> 00:04:25,710 Also recommend checking it out and a lot of different devices as well. 69 00:04:26,370 --> 00:04:30,600 So if it's, for example, an iPad Fifth-Generation, this is what it would look like. 70 00:04:30,990 --> 00:04:35,920 As you can see, with cutting out little bits of the side of the screen, the iPod. 71 00:04:37,830 --> 00:04:45,210 And if it's an iPod pro Apple, iPhone 11, we've got a little bit more of the screen there. 72 00:04:45,540 --> 00:04:47,430 We've also got this little bubble there as well. 73 00:04:47,820 --> 00:04:56,910 But we can definitely still interact with this iPhone six, etc. So it's a Google Pixel three. 74 00:04:58,020 --> 00:05:00,000 It's going to show you what this is going to look like. 75 00:05:00,000 --> 00:05:02,340 And it's pretty accurate representation as well. 76 00:05:04,440 --> 00:05:13,590 So just go through quite a few of them and see what they look like, make sure that it's not excluded 77 00:05:13,590 --> 00:05:16,470 in any way or it's halfway through the screen or something. 78 00:05:21,500 --> 00:05:21,920 Yeah. 79 00:05:22,340 --> 00:05:22,790 OK. 80 00:05:24,220 --> 00:05:25,960 That's an interesting screen size. 81 00:05:27,230 --> 00:05:28,660 That's the very last one as well. 82 00:05:29,320 --> 00:05:29,680 OK. 83 00:05:30,010 --> 00:05:31,120 Yes, I'm quite happy with that. 84 00:05:31,120 --> 00:05:33,880 So I'm going to go back to my Samsung Galaxy seven. 85 00:05:34,330 --> 00:05:39,910 And what I want to do is I want to make sure that this item is always targeted to the bottom left hand 86 00:05:39,910 --> 00:05:44,790 corner can do so by using these anchors, and it's automatically done that for me. 87 00:05:44,800 --> 00:05:46,030 Which bottom left? 88 00:05:46,420 --> 00:05:49,930 If I did top right, it would always be anchored to the top right of the screen. 89 00:05:50,590 --> 00:05:55,330 But bottom left means that if the screen gets bigger, it will always try and stay in the bottom left 90 00:05:55,330 --> 00:05:57,370 hand corner, which is what it's doing. 91 00:05:59,740 --> 00:06:02,920 And so let's take a look. 92 00:06:02,950 --> 00:06:06,880 Make sure that this script always stays switched on. 93 00:06:07,360 --> 00:06:12,070 You can change these items if you want, but I'm not going to I'm quite happy with what I've got at 94 00:06:12,070 --> 00:06:12,640 the moment. 95 00:06:13,210 --> 00:06:16,780 This outer ring moment is a little bit too light for my liking. 96 00:06:16,780 --> 00:06:19,750 So I'm going to click on this and I'm going to make it a black ring. 97 00:06:20,200 --> 00:06:20,580 OK. 98 00:06:21,520 --> 00:06:25,150 And it does need to be a rakas target so that we can interact with it. 99 00:06:25,600 --> 00:06:26,530 Musker bullets. 100 00:06:26,530 --> 00:06:30,750 Well, then we get a handle on the inside. 101 00:06:30,750 --> 00:06:32,200 That's this little circle. 102 00:06:32,890 --> 00:06:37,450 Now what I'm going to do them to click on Antil Plain and you'll see that you got a whole bunch of different 103 00:06:37,450 --> 00:06:37,780 things. 104 00:06:38,080 --> 00:06:41,300 I like this Andal ridged the drug, that one. 105 00:06:42,130 --> 00:06:45,850 And he looks a little bit more effective now because it's Halloween style. 106 00:06:45,850 --> 00:06:48,390 I want something that looks a bit more pumpkin like. 107 00:06:48,430 --> 00:06:53,050 So I'm going to click on this and I'm going to make it like a really interesting sort of orange color. 108 00:06:54,280 --> 00:06:56,980 Once again, Rakaa tailgate and musket ball. 109 00:06:57,800 --> 00:06:58,020 All right. 110 00:06:58,030 --> 00:06:58,480 Excellent. 111 00:06:58,930 --> 00:06:59,410 That's it. 112 00:06:59,740 --> 00:07:01,720 We're set up with our joystick. 113 00:07:01,960 --> 00:07:04,330 So now it's time to actually write a script. 114 00:07:04,890 --> 00:07:09,190 Going to go back to our sets and the right click, create a new folder. 115 00:07:09,700 --> 00:07:13,390 I'm going to call it my scripts. 116 00:07:16,270 --> 00:07:20,800 Double click inside, right click, choose create new Souchak script. 117 00:07:21,250 --> 00:07:24,040 This one, I'll call it main. 118 00:07:26,730 --> 00:07:27,240 Just mate. 119 00:07:27,360 --> 00:07:33,720 All right, and it comes out as may not see us as a C sharp double click in order to open in. 120 00:07:36,530 --> 00:07:39,500 Visual Studio, there we go, may take a while for that to open. 121 00:07:39,920 --> 00:07:44,870 If this is the first time you're opening a Visual Studio, give it the rights to action to get online, 122 00:07:44,870 --> 00:07:54,500 etc. And you will also have to log in using your unity ID, your version of Visual Studio might be like 123 00:07:54,500 --> 00:07:55,490 a white background. 124 00:07:55,610 --> 00:08:00,200 Well, I actually changed mine by going to where it was at. 125 00:08:05,670 --> 00:08:07,530 We remember how to do this. 126 00:08:14,100 --> 00:08:17,940 Uh, I'm looking for properties. 127 00:08:17,970 --> 00:08:18,480 There we go. 128 00:08:18,860 --> 00:08:19,470 But you wouldn't know. 129 00:08:19,590 --> 00:08:20,090 Oh, nope. 130 00:08:20,800 --> 00:08:27,120 Properties, OK, project and looking for some sort of settings. 131 00:08:34,580 --> 00:08:36,780 Don't think his options, tools, options. 132 00:08:36,800 --> 00:08:37,400 That's the one. 133 00:08:37,890 --> 00:08:40,940 OK, and general color theme dark. 134 00:08:41,240 --> 00:08:42,980 All right, guys, that's all I've chosen. 135 00:08:43,490 --> 00:08:46,860 You do get a bunch of different ones if if you want to go with that. 136 00:08:46,880 --> 00:08:48,290 OK, great. 137 00:08:49,910 --> 00:08:52,490 So this is what your general script looks like. 138 00:08:52,490 --> 00:08:54,890 They've already completed a bit of it for you. 139 00:08:54,980 --> 00:09:01,430 These are a couple of popular methods from the start method runs when the game first, starts the first 140 00:09:01,430 --> 00:09:03,320 frame and then never runs again. 141 00:09:04,550 --> 00:09:06,590 The update is called Every Frame. 142 00:09:07,040 --> 00:09:12,830 So if your game is running like 60 frames a second, the update will be called 60 times a second. 143 00:09:13,580 --> 00:09:14,870 That's going to be important for us. 144 00:09:15,470 --> 00:09:17,860 OK, so let's begin. 145 00:09:18,140 --> 00:09:25,880 So, first of all, we need access to our joystick so we can time public off type joystick that we're 146 00:09:25,880 --> 00:09:31,100 going to call joystick semicolon on the end to finish. 147 00:09:31,610 --> 00:09:37,550 Now, what we've done there is we've simply made a slot that's going to be available in the inspector 148 00:09:38,000 --> 00:09:42,320 by making it public means that it's going to be visible in the editor if it was private. 149 00:09:42,350 --> 00:09:45,170 It won't be visible in the editor of type. 150 00:09:46,310 --> 00:09:50,960 When it goes green, it basically means it recognizes as a type of a joystick. 151 00:09:50,990 --> 00:09:52,760 And we've given it a specific name. 152 00:09:53,570 --> 00:09:54,950 So if I were to save that now. 153 00:09:57,720 --> 00:09:58,860 Wait for that to compile. 154 00:09:59,520 --> 00:10:03,960 In other woods is converting it into machine language or whatever it needs. 155 00:10:05,010 --> 00:10:14,910 I'm going to go to uh I'm going to go to ground, I think, and I'm just going to drag me directly onto 156 00:10:14,910 --> 00:10:15,450 ground. 157 00:10:16,140 --> 00:10:16,980 OK, that's it. 158 00:10:17,520 --> 00:10:18,900 And that's what we've created. 159 00:10:19,170 --> 00:10:21,690 We've created this little slot. 160 00:10:21,990 --> 00:10:28,530 OK, now we can take our joystick, just drag it directly in there so that now it can talk directly 161 00:10:28,530 --> 00:10:29,430 to that joystick. 162 00:10:32,580 --> 00:10:37,500 And now I need access to the camera so I can move that so public. 163 00:10:38,010 --> 00:10:39,810 Of type game object. 164 00:10:40,590 --> 00:10:45,720 And you can just present it to autocomplete or return and I'll call this camp. 165 00:10:48,600 --> 00:10:52,080 OK, once again, we've made another slot, so let's just say this. 166 00:10:58,300 --> 00:11:01,840 And then let's take our main camera, drag that into come. 167 00:11:02,030 --> 00:11:04,300 So that's now what we're going to be manipulating the movie. 168 00:11:05,710 --> 00:11:12,100 OK, and then and what we need to know now is the rotation amount. 169 00:11:12,220 --> 00:11:16,180 So this time, we don't need to define this in the inspectors film to make this private. 170 00:11:16,690 --> 00:11:18,400 It's going to be of type float. 171 00:11:18,670 --> 00:11:20,740 Float is basically a decimal number. 172 00:11:21,430 --> 00:11:22,510 I'm going to call this. 173 00:11:24,660 --> 00:11:27,600 Let me start off with a lowercase letter. 174 00:11:27,690 --> 00:11:34,650 So, Robert, as in reputation, capital H, capital a what? 175 00:11:34,650 --> 00:11:36,510 A H amounts. 176 00:11:36,990 --> 00:11:37,320 OK. 177 00:11:37,560 --> 00:11:43,440 So in other words, rotation, horizontal amount, an amusing camel case here, which basically means 178 00:11:43,440 --> 00:11:49,650 you start off with a lowercase letter and every time you change the word, you use, not the case letter 179 00:11:50,100 --> 00:11:51,460 whenever you use these names. 180 00:11:51,480 --> 00:11:52,890 Never leaves spaces. 181 00:11:53,290 --> 00:11:55,440 OK, it must all be one letter. 182 00:11:55,800 --> 00:11:59,670 And the second great reason why it's telling me it's not being used. 183 00:11:59,850 --> 00:12:01,950 Well, not yet, because I've not written anything yet. 184 00:12:01,950 --> 00:12:07,380 But it's it's good that it actually tells you whether you're using something or not. 185 00:12:08,520 --> 00:12:10,450 And do the same again, private float. 186 00:12:10,470 --> 00:12:13,530 This time, it's going to be dropped the amount. 187 00:12:15,480 --> 00:12:17,670 So then there was the vertical and horizontal. 188 00:12:19,110 --> 00:12:22,530 OK, then I need to decide exactly how fast am I going to rotate. 189 00:12:23,130 --> 00:12:25,720 So this is going to be public is available. 190 00:12:25,740 --> 00:12:28,710 Inspectah, we can change it in the inspector of time. 191 00:12:28,710 --> 00:12:30,570 Float again, decimal number. 192 00:12:30,810 --> 00:12:33,810 Call this rotation speed. 193 00:12:36,770 --> 00:12:39,890 Press equals and set this to about 35. 194 00:12:42,140 --> 00:12:46,460 OK, so that's exactly how fast we are going to be moving. 195 00:12:47,870 --> 00:12:50,810 Now, I'm not putting in the start. 196 00:12:50,810 --> 00:12:55,880 I need to put in the update because I need this to basically update literally every frame. 197 00:12:56,480 --> 00:13:03,050 And what I want to do is associate the rot H amount and the V amount with movement of the joystick. 198 00:13:03,510 --> 00:13:07,730 Well, say, what's the amount to begin with? 199 00:13:08,720 --> 00:13:11,460 Equals joystick. 200 00:13:12,830 --> 00:13:17,690 Now, as soon as you press, don't we get access to all of the properties that belong to the joystick, 201 00:13:17,990 --> 00:13:19,610 one of which will be vertical? 202 00:13:20,540 --> 00:13:27,620 OK, so the vertical input is going to be passed through into this variable here and it's going to store 203 00:13:27,620 --> 00:13:28,190 that number. 204 00:13:29,600 --> 00:13:35,150 What's H amount equals? 205 00:13:35,150 --> 00:13:36,680 And you've guessed it joystick. 206 00:13:37,310 --> 00:13:38,990 The horizontal. 207 00:13:40,130 --> 00:13:40,610 There we go. 208 00:13:40,670 --> 00:13:42,560 So we've just passed those values through. 209 00:13:43,070 --> 00:13:50,300 Now, what we need to do is move our camera so we can say, can dart transform, dart rotate. 210 00:13:51,830 --> 00:13:53,090 OK, is capital R. 211 00:13:54,170 --> 00:13:58,940 And then as soon as we open our brackets, it tells us exactly what its expected is expecting some Oyola 212 00:13:58,940 --> 00:13:59,750 angles. 213 00:14:00,620 --> 00:14:11,390 OK, so and what we're going to do is we're going to pass in the minus what the amount into the X. 214 00:14:12,550 --> 00:14:14,890 OK, and I'm doing minus of it's reversed. 215 00:14:15,260 --> 00:14:18,910 Otherwise, it's when you move, right, you're going to move left. 216 00:14:19,090 --> 00:14:20,320 When you move left, you're going to move. 217 00:14:20,320 --> 00:14:20,660 Right. 218 00:14:20,660 --> 00:14:26,710 So I'm sort of reversing that and then I'm going to multiply that by the rotation speed. 219 00:14:30,280 --> 00:14:32,920 OK, so that's the speed at which they're going to rotate. 220 00:14:33,340 --> 00:14:40,360 Furthermore, I'm going to multiply that by time dot delta time and comma. 221 00:14:40,740 --> 00:14:45,280 OK, so time dot delta time basically means each and every second. 222 00:14:46,040 --> 00:14:46,230 All right. 223 00:14:46,270 --> 00:14:47,920 It's going to do that per second. 224 00:14:48,550 --> 00:14:53,350 If you don't put time that Delta time in there, what it does, it uses your frame time, seconds. 225 00:14:53,980 --> 00:14:56,950 So it's running at 60 frames per second. 226 00:14:56,950 --> 00:15:00,130 It will be doing running that command 60 times a second. 227 00:15:00,580 --> 00:15:05,380 If your mobile's really not like two frames a second, you're doing that two times a second. 228 00:15:05,950 --> 00:15:10,620 This ensures that it always runs at the exact same time on every device. 229 00:15:10,690 --> 00:15:11,260 Always. 230 00:15:11,290 --> 00:15:12,070 Exactly. 231 00:15:12,280 --> 00:15:13,870 Once per second. 232 00:15:15,310 --> 00:15:17,530 OK, then in the middle. 233 00:15:17,680 --> 00:15:23,440 So if that if that's the X rotation value, this will be the Y rotation value now. 234 00:15:23,950 --> 00:15:25,960 And I'm going to pretty much do the same. 235 00:15:25,960 --> 00:15:31,540 So I'm going to say what's h amounts multiplied by rotation. 236 00:15:31,540 --> 00:15:36,100 Speed multiplied by time, Delta time. 237 00:15:38,170 --> 00:15:42,340 And then finally on the Z axis, I'm going to say zero. 238 00:15:42,490 --> 00:15:47,650 Don't want it to move at all on the axis, just semicolon on the end. 239 00:15:49,930 --> 00:15:51,190 So let's take a look at that. 240 00:15:51,700 --> 00:15:53,740 So on that main camera. 241 00:15:58,040 --> 00:15:58,970 We have to transform. 242 00:15:59,120 --> 00:16:04,640 We've accessed we've got a rotation, we've accessed and we're saying move these values on the X and 243 00:16:04,640 --> 00:16:11,240 the Y according to our we're and moving our joystick, whatever values we have coming from there, we're 244 00:16:11,240 --> 00:16:13,670 going to pass through into this X and Y. 245 00:16:14,360 --> 00:16:17,360 And that's going to then rotate our camera according to that. 246 00:16:18,500 --> 00:16:20,300 Now, the moment it's not going to work correctly. 247 00:16:20,510 --> 00:16:25,220 I'm going to show you why and then I'm going to give you a task, see if you can fix it. 248 00:16:27,190 --> 00:16:29,120 And I will be showing you how to fix it, by the way. 249 00:16:30,710 --> 00:16:34,490 But for now, that is going to get a camera working perfectly fine. 250 00:16:35,120 --> 00:16:35,450 All right. 251 00:16:35,450 --> 00:16:43,460 So and let me just click on ground, make sure that all my slots are all perfectly felt and make sure 252 00:16:43,460 --> 00:16:47,810 that none of those are saying none, because if any of those are saying non, you're going to get a 253 00:16:47,810 --> 00:16:48,410 read error. 254 00:16:48,890 --> 00:16:52,370 And it's going to be a null reference exception error that you get. 255 00:16:53,030 --> 00:16:53,360 OK. 256 00:16:53,720 --> 00:16:58,790 So make sure that you're in simulator mode and we can press play. 257 00:16:59,030 --> 00:17:02,600 Our mouse is going to act like our finger on the mobile device. 258 00:17:02,870 --> 00:17:04,650 It's going to allow us to manipulate this. 259 00:17:05,300 --> 00:17:06,470 So let's press play. 260 00:17:09,820 --> 00:17:10,330 Here we go. 261 00:17:10,690 --> 00:17:13,240 Now, when I move, I'm moving my camera. 262 00:17:13,790 --> 00:17:15,770 But if I move up, it does move up. 263 00:17:16,060 --> 00:17:19,600 If I try moving both at the same time, whoa, check out what happened. 264 00:17:21,640 --> 00:17:28,240 I'm sort of getting this weird angle going on, which is which is not what you want. 265 00:17:28,540 --> 00:17:28,930 All right. 266 00:17:28,940 --> 00:17:35,620 You want it always to stay straight upright and not to be doing this weird angle. 267 00:17:36,070 --> 00:17:42,310 So I want to give you a task, see by the next video, if you can figure out a solution to get that 268 00:17:42,310 --> 00:17:46,060 fixed so that when you move left and right, it moves left and right perfectly. 269 00:17:46,060 --> 00:17:48,760 And when you move up and down, it moves up and down perfectly. 270 00:17:49,000 --> 00:17:53,890 The two did not work together to get this weird angle. 271 00:17:53,890 --> 00:17:55,420 Angular motion is going on. 24794

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