1 00:00:27.345 --> 00:00:29.054 Hello, this is Yeong-hoon Lee 2 00:00:29.559 --> 00:00:34.634 Today we will create User Input Mapping and Player Actor 3 00:00:35.119 --> 00:00:38.149 This chapter will create an environment using Blueprint 4 00:00:38.149 --> 00:00:42.644 A project for creating a shooter game 5 00:00:42.991 --> 00:00:45.946 And we will learn about the core of Unreal Engine 6 00:00:45.946 --> 00:00:49.830 Which is Actor and its components 7 00:00:49.830 --> 00:00:53.495 And we will also learn about how to 8 00:00:53.862 --> 00:00:58.526 Move objects with user input 9 00:00:59.188 --> 00:01:03.000 Creating Prototyping Environment 10 00:01:04.160 --> 00:01:07.868 We will be creating a Blueprint-based shooter project 11 00:01:09.046 --> 00:01:14.018 A shooter project is simple, it has the player 12 00:01:14.800 --> 00:01:17.431 And then its enemies here 13 00:01:18.639 --> 00:01:20.075 And we have some bullets 14 00:01:20.303 --> 00:01:25.028 So these are the three characters 15 00:01:25.028 --> 00:01:26.413 Or three Actors 16 00:01:26.760 --> 00:01:30.799 And if the bullet hits the enemy, or the enemy hits the player 17 00:01:31.175 --> 00:01:34.195 The latter will be destroyed; that's the simple mechanism 18 00:01:34.640 --> 00:01:41.624 So today we will focus on this player 19 00:01:41.624 --> 00:01:43.231 And we will start a new project 20 00:01:43.231 --> 00:01:48.238 So we will be able to learn about the first things we need to do 21 00:01:48.238 --> 00:01:50.223 When we make a new project 22 00:01:50.807 --> 00:01:53.722 So let's start by creating a project 23 00:01:54.118 --> 00:01:55.717 Run your Unreal 24 00:02:00.720 --> 00:02:04.189 Let's make a Blank project 25 00:02:04.189 --> 00:02:07.985 And Blueprint, include Starter Content 26 00:02:09.737 --> 00:02:11.109 And let's name it a shooter 27 00:02:14.600 --> 00:02:16.538 For Blueprint, 28 00:02:18.960 --> 00:02:20.663 Let's say BP 29 00:02:20.663 --> 00:02:23.217 BP_Shooting, let's do that 30 00:02:27.199 --> 00:02:28.228 Create 31 00:02:36.777 --> 00:02:39.010 Now we have a project 32 00:02:39.723 --> 00:02:43.295 So the first thing is to create our Level 33 00:02:44.404 --> 00:02:49.867 Open this Content Drawer, and we only have Starter Content 34 00:02:49.867 --> 00:02:53.038 Let's create some folders here 35 00:02:54.266 --> 00:02:55.867 Press Add here 36 00:02:57.639 --> 00:03:01.847 Select New Folder, name it 'Maps' 37 00:03:03.837 --> 00:03:07.384 We'll make some maps, and let's make a folder for Blueprint 38 00:03:08.463 --> 00:03:11.762 You could do this or press Add 39 00:03:11.762 --> 00:03:13.019 See, 'New Folder' 40 00:03:13.230 --> 00:03:21.194 Or at Content Drawer, right click 41 00:03:21.194 --> 00:03:23.553 And there's also 'New Folder', the menu is the same 42 00:03:23.959 --> 00:03:27.178 Click, 'Blueprints' 43 00:03:30.279 --> 00:03:32.469 That's the folder name we have 44 00:03:34.974 --> 00:03:38.861 And let's make a map to process it 45 00:03:39.682 --> 00:03:44.001 This map here isn't the one saved 46 00:03:44.001 --> 00:03:48.223 It's the default map we get when we first run it 47 00:03:48.223 --> 00:03:50.395 We won't be using this 48 00:03:51.167 --> 00:03:56.022 At File, we have New Level, click on it 49 00:03:56.517 --> 00:03:58.366 And we have four maps 50 00:03:58.366 --> 00:04:01.286 Notice how each pair has the same theme 51 00:04:02.296 --> 00:04:04.909 The right two are the basic ones 52 00:04:04.909 --> 00:04:09.882 The maps that we use a lot for a standalone format 53 00:04:10.169 --> 00:04:13.992 And the left two have the concept called 'World Partition' 54 00:04:13.992 --> 00:04:19.983 Which processes multiple levels of a map, which is a complicated job 55 00:04:20.469 --> 00:04:24.078 So this Level helps with such things 56 00:04:24.266 --> 00:04:27.046 Here, we will go with the basic, simple Level 57 00:04:27.758 --> 00:04:30.054 It's a shooter, so the Level will be empty 58 00:04:30.054 --> 00:04:32.498 Let's start at this Empty Level 59 00:04:34.121 --> 00:04:37.189 Create, and this Level has nothing 60 00:04:39.767 --> 00:04:40.962 Let's first save 61 00:04:40.962 --> 00:04:43.964 Ctrl S will save the proejct 62 00:04:45.627 --> 00:04:48.596 Let's save it under 'Maps' folder 63 00:04:49.655 --> 00:04:52.788 Here, it says 'NewMap' but let's say 'GameMap' 64 00:04:58.146 --> 00:05:00.534 'GameMap', and now save 65 00:05:00.534 --> 00:05:05.785 And at Content Drawer, we have our 'GameMap' here 66 00:05:06.399 --> 00:05:10.122 Also at the top on this tab it says 'GameMap' 67 00:05:11.499 --> 00:05:13.187 At Outliner too, 'GameMap' 68 00:05:13.187 --> 00:05:16.480 So when you're checking for what this map you have is 69 00:05:16.480 --> 00:05:21.756 You can check for its name at this tab or at this Outliner 70 00:05:23.746 --> 00:05:27.972 And, when we first run this map 71 00:05:27.972 --> 00:05:30.994 It should be this map that opens 72 00:05:31.628 --> 00:05:36.349 So we will do some work on this Level 73 00:05:36.349 --> 00:05:38.973 But we need to do something else before that 74 00:05:39.320 --> 00:05:43.175 At an Unreal Level 75 00:05:43.175 --> 00:05:47.911 It has to have its own Game Mode 76 00:05:47.911 --> 00:05:51.468 So you first create Game Mode and add its player 77 00:05:51.468 --> 00:05:55.904 And add all the settings before we process with it 78 00:05:56.320 --> 00:05:58.241 So let's create a Game Mode 79 00:05:58.795 --> 00:06:00.746 Let's make it under 'Blueprints' folder 80 00:06:02.676 --> 00:06:07.058 Blueprints, right click on it and we have this 81 00:06:07.058 --> 00:06:10.008 'Blueprint Class', let's create this 82 00:06:11.958 --> 00:06:16.029 And we have 'Game Mode Base' here 83 00:06:17.187 --> 00:06:19.638 So this will be the parent 84 00:06:19.638 --> 00:06:24.962 Let's create an Actor, whose parent is this 'Game Mode Base' 85 00:06:26.576 --> 00:06:27.739 Click on this 86 00:06:27.739 --> 00:06:28.749 And it looks like this 87 00:06:29.175 --> 00:06:35.085 This is Gam eMode, so 'BP_'... It's Game Mode of GameMap 88 00:06:35.679 --> 00:06:39.376 Game, let's just say 'GameMode' 89 00:06:41.049 --> 00:06:43.826 'BP_GameModeBase' is the name 90 00:06:44.717 --> 00:06:46.218 Let's save here 91 00:06:50.644 --> 00:06:54.801 And we will place it on this Level 92 00:06:55.752 --> 00:06:57.716 Here, go to Edit 93 00:06:58.440 --> 00:07:01.842 And we have 'Project Settings' 94 00:07:02.792 --> 00:07:07.066 Click on 'Project Settings' and we get this window 95 00:07:07.977 --> 00:07:10.577 And this must be the default setting you have 96 00:07:13.826 --> 00:07:16.138 This is how it looks like 97 00:07:17.464 --> 00:07:20.817 And with this, you may confuse the upper tab of 98 00:07:20.817 --> 00:07:22.720 This window as over here 99 00:07:22.720 --> 00:07:25.209 But this is the original form, and there's a separate one here 100 00:07:25.209 --> 00:07:27.559 Let's bring it up here like this 101 00:07:27.559 --> 00:07:31.234 So that they belong to the same tab group 102 00:07:32.135 --> 00:07:34.748 So here, at Project Settings 103 00:07:34.748 --> 00:07:37.266 Among many things, let's go with 104 00:07:37.969 --> 00:07:39.657 'Maps & Modes' 105 00:07:40.459 --> 00:07:43.046 So click on 'Maps & Modes' 106 00:07:43.858 --> 00:07:46.959 And at the top we have 'Default Modes' 107 00:07:46.959 --> 00:07:49.748 This is where GameMode goes in 108 00:07:49.748 --> 00:07:53.843 And here, GameModeBase is placed in here as well 109 00:07:54.457 --> 00:07:58.031 Click on this and, see our GameMode that we created? 110 00:07:58.754 --> 00:08:00.676 Let's replace it with this 111 00:08:02.647 --> 00:08:07.598 This will be the default Game Mode for all Levels 112 00:08:08.440 --> 00:08:12.785 Meaning, we have a Level we just created 113 00:08:13.488 --> 00:08:14.867 This map is called a Level 114 00:08:15.412 --> 00:08:17.189 And if we make another Level 115 00:08:17.189 --> 00:08:19.782 This Level will also have 116 00:08:20.099 --> 00:08:23.201 This Game Mode as its default setting 117 00:08:24.726 --> 00:08:26.983 But as we work through, we may need 118 00:08:27.082 --> 00:08:30.532 Separate Game Mode for each Level 119 00:08:30.859 --> 00:08:32.470 And what do we do for that? 120 00:08:32.728 --> 00:08:35.697 First, open this Level 121 00:08:35.697 --> 00:08:38.093 Double click to open the Level 122 00:08:38.400 --> 00:08:41.352 And to the right, we have 'Settings' 123 00:08:42.016 --> 00:08:46.226 Click on 'Settings' and we have 'World Settings' 124 00:08:47.028 --> 00:08:48.438 Let's click on that 125 00:08:48.438 --> 00:08:53.214 And next to Details, we now have this window, 'World Settings' 126 00:08:53.917 --> 00:08:58.080 And here, we have 'GameMode Override' 127 00:08:58.080 --> 00:08:59.597 And it says 'None' here 128 00:09:00.587 --> 00:09:03.923 Meaning, the Default Game Mode that we set at Project Settings 129 00:09:04.072 --> 00:09:05.965 That will be the Game Mode for this Level 130 00:09:06.638 --> 00:09:09.579 And if we click this to change it 131 00:09:09.965 --> 00:09:14.440 The Game Mode for this Level will be this 132 00:09:14.440 --> 00:09:15.449 That's what it means 133 00:09:15.449 --> 00:09:16.949 So when you work on your project 134 00:09:17.355 --> 00:09:21.944 If you want to make many Game Modes to set to each of the Levels 135 00:09:22.320 --> 00:09:25.409 Don't do each of it at Project Settings 136 00:09:26.419 --> 00:09:28.765 Instead, at World Settings of each Level 137 00:09:29.072 --> 00:09:31.547 You can place each to its right pair like this 138 00:09:32.607 --> 00:09:35.807 So for me, I will set it at World Setting like this 139 00:09:36.559 --> 00:09:38.908 The one at Project Settings is no longer needed 140 00:09:38.908 --> 00:09:40.752 So we can change it back 141 00:09:41.168 --> 00:09:42.372 Because we do not use it 142 00:09:42.906 --> 00:09:46.498 And to see its settings, open 'Selected GameMode' 143 00:09:46.498 --> 00:09:49.634 And we see the content here 144 00:09:50.089 --> 00:09:53.677 It has Default Pawn Class 145 00:09:53.677 --> 00:09:56.910 Also HUD, for Head-Up Display 146 00:09:57.346 --> 00:10:01.020 HUD, and Player Controller 147 00:10:01.020 --> 00:10:04.158 Game State, Player State, and many more 148 00:10:06.168 --> 00:10:08.247 This is obviously at World Settings as well 149 00:10:08.960 --> 00:10:13.065 Here, at World Settings, it also has Selected GameMode 150 00:10:13.065 --> 00:10:14.823 Open it up, and this is it 151 00:10:15.308 --> 00:10:17.020 And we can change each like so 152 00:10:18.149 --> 00:10:23.021 Of course, the default Game Mode, GameModeBase, is a read-only one 153 00:10:23.219 --> 00:10:24.186 Which we cannot edit 154 00:10:24.186 --> 00:10:27.618 But if it's our custom Game Mode, we can change its parts 155 00:10:28.935 --> 00:10:30.194 So let's do that 156 00:10:30.194 --> 00:10:32.090 And now we need our player character 157 00:10:33.763 --> 00:10:36.528 Let's create that, after we save it 158 00:10:37.567 --> 00:10:40.328 And at Blueprints here 159 00:10:41.427 --> 00:10:45.477 Right click to make another Blueprint Class 160 00:10:47.496 --> 00:10:52.173 Here, we will use not an Actor but this thing called a Pawn 161 00:10:52.450 --> 00:10:54.347 Let me briefly explain what it is 162 00:10:59.928 --> 00:11:01.089 So this is the concept here 163 00:11:05.237 --> 00:11:07.835 So, an Actor Class 164 00:11:08.063 --> 00:11:13.921 It's the minimum of classes that can be born at a Level 165 00:11:13.921 --> 00:11:17.100 So this class can be placed in the World 166 00:11:18.416 --> 00:11:22.127 And something that inherits this Actor Class at World 167 00:11:22.127 --> 00:11:23.585 This class is called Pawn 168 00:11:24.308 --> 00:11:28.157 Starting with Pawn, the class can receive input from the user 169 00:11:28.355 --> 00:11:31.144 While Actor does not allow inputs from the user 170 00:11:31.144 --> 00:11:35.720 Of course, we can process it so that it can somehow receive it 171 00:11:35.720 --> 00:11:43.521 But in basic terms, an Actor is something that does not receive any inputs 172 00:11:44.263 --> 00:11:47.510 Only classes starting with Pawn can receive them 173 00:11:47.599 --> 00:11:51.017 Of course, if we have two or three Pawn Classes 174 00:11:51.165 --> 00:11:53.208 It's not that all of them gets the input 175 00:11:53.960 --> 00:11:57.368 For an Unreal user 176 00:11:57.368 --> 00:12:01.933 When the user processes an input 177 00:12:04.319 --> 00:12:06.139 There's Player Controller 178 00:12:06.149 --> 00:12:09.158 Which has the concept of possession 179 00:12:09.158 --> 00:12:13.970 And it can control starting with the Pawn that it has Possessed 180 00:12:13.970 --> 00:12:15.242 That's what can get the input 181 00:12:15.628 --> 00:12:18.536 So even with many different Pawns 182 00:12:18.882 --> 00:12:21.388 Or even a character that inherits a Pawn 183 00:12:21.388 --> 00:12:24.653 So Actor, Pawn and Character are the 184 00:12:24.980 --> 00:12:28.756 Three representative Classes at Unreal 185 00:12:29.270 --> 00:12:35.451 For an Actor Class, they are the placed-things 186 00:12:35.679 --> 00:12:37.643 And for Pawn and Character 187 00:12:37.979 --> 00:12:42.379 It's like a chess piece that one can hold and move around 188 00:12:42.587 --> 00:12:43.781 That's what they are 189 00:12:44.365 --> 00:12:47.262 So we'll make our player a Pawn Class 190 00:12:47.401 --> 00:12:49.847 What's different between Pawn and Character? 191 00:12:50.243 --> 00:12:53.302 Pawn does not have a particular shape 192 00:12:54.144 --> 00:12:57.987 It could be a car, or a plane 193 00:12:57.987 --> 00:13:01.985 Or a carriage, something like that 194 00:13:02.520 --> 00:13:06.246 If I want a puppy as my Pawn 195 00:13:06.246 --> 00:13:07.834 Then we need to use a Pawn 196 00:13:08.537 --> 00:13:13.109 But for humans, with two legs 197 00:13:13.109 --> 00:13:17.365 If we want a player that is a human 198 00:13:17.365 --> 00:13:20.285 We can choose the Character Class 199 00:13:20.918 --> 00:13:23.954 So in this example, we're using a shooter 200 00:13:23.954 --> 00:13:27.584 So for shooter, we will create our player using Pawn Class 201 00:13:28.039 --> 00:13:32.002 Later, we will be working on TPS 202 00:13:32.230 --> 00:13:36.233 And we will be able to work with the Character Class then 203 00:13:36.867 --> 00:13:38.985 For today, let's try Pawn 204 00:13:38.985 --> 00:13:42.314 So this is the gist of them 205 00:13:42.799 --> 00:13:45.848 Here it says that Pawn Class can use Static Mesh 206 00:13:46.055 --> 00:13:50.392 It's based on the default settings 207 00:13:50.789 --> 00:13:53.240 We could use Skeletal Mesh here as well 208 00:13:54.586 --> 00:13:59.649 So for the player character, they can do all the human things 209 00:13:59.649 --> 00:14:02.602 Such as to jump, to swim 210 00:14:03.572 --> 00:14:05.466 Of course, it doesn't just automatically work 211 00:14:05.466 --> 00:14:07.603 You need some extra work to make it happen 212 00:14:07.910 --> 00:14:12.938 But anyways, there are such components that are provided based on them 213 00:14:12.938 --> 00:14:14.747 Which allow for such things 214 00:14:15.638 --> 00:14:16.719 Going back 215 00:14:16.867 --> 00:14:22.060 Let's create a player that inherits a Pawn Class 216 00:14:22.397 --> 00:14:28.118 For this, shall we call it 'BP_Player'? 217 00:14:32.511 --> 00:14:37.984 So let's check for World Settings 218 00:14:37.984 --> 00:14:39.941 See BP_Player here? 219 00:14:39.941 --> 00:14:41.386 You could switch it here 220 00:14:41.554 --> 00:14:47.235 Or you can double click on our Game Mode Base to open it 221 00:14:47.799 --> 00:14:50.624 And here at Details we have the content as well 222 00:14:51.010 --> 00:14:53.998 Here, we have the player: Default Pawn Class 223 00:14:53.998 --> 00:14:58.043 You can switch it to out BP_Player and compile 224 00:14:58.520 --> 00:15:00.292 And when you come back here, this part will be changed 225 00:15:01.123 --> 00:15:03.618 You can change it here to change it there 226 00:15:04.400 --> 00:15:07.839 And change it there to change it here, it's the same thing 227 00:15:08.572 --> 00:15:10.615 Let's assign it like so 228 00:15:11.407 --> 00:15:13.315 I will use my preferred layout 229 00:15:14.523 --> 00:15:17.979 I'll go with the Classic Layout 230 00:15:19.038 --> 00:15:23.128 Sometimes, when you open a Blueprint Class 231 00:15:23.128 --> 00:15:25.643 It may look like this, without showing everything 232 00:15:25.643 --> 00:15:29.624 Here, just go to the top where it says 'Open Full Blueprint Editor' 233 00:15:29.624 --> 00:15:31.664 Click this to bring back that familiar view 234 00:15:32.298 --> 00:15:33.212 That's how it works 235 00:15:34.637 --> 00:15:41.108 I will chek for Always here so that it compiles and then automatically saves 236 00:15:44.147 --> 00:15:45.874 That's it 237 00:15:46.210 --> 00:15:52.682 And now, I want to see this map right away when I open my Unreal 238 00:15:52.810 --> 00:15:54.926 Until now, it has not been set that way 239 00:15:55.470 --> 00:15:57.969 We only placed this at this Level 240 00:15:58.256 --> 00:16:03.248 For this, go to Edit, Project Settings 241 00:16:04.783 --> 00:16:07.237 Here, we have Maps & Modes 242 00:16:07.237 --> 00:16:10.173 We used to deal with the Game Mode on the top 243 00:16:10.440 --> 00:16:13.766 But right below that category, we have Default Maps 244 00:16:13.766 --> 00:16:17.706 So here, 'Editor Startup Map' 245 00:16:18.221 --> 00:16:22.386 Let's place our own GameMap we just created 246 00:16:22.386 --> 00:16:25.194 Now, when we open our Unreal Engine 247 00:16:25.719 --> 00:16:28.408 This map will be loaded right away 248 00:16:30.250 --> 00:16:34.761 It's thanks to this Default Startup Map 249 00:16:35.019 --> 00:16:38.207 Now we also have Game Default Map, which is 250 00:16:38.722 --> 00:16:42.397 Something we created at Unreal is not limited to open at Editor 251 00:16:42.397 --> 00:16:45.067 We can build it to create an executable (exe) file 252 00:16:45.364 --> 00:16:47.623 Which we can publish later 253 00:16:48.058 --> 00:16:52.521 And this means the map that first opens in that exe file 254 00:16:52.521 --> 00:16:56.450 So we can set our GameMap here as well 255 00:16:57.599 --> 00:17:00.634 So when we build it in an exe file, it will also open our GameMap 256 00:17:01.327 --> 00:17:02.808 That's what it means 257 00:17:08.798 --> 00:17:13.739 So with this setting 258 00:17:14.630 --> 00:17:16.886 We can run it now 259 00:17:17.569 --> 00:17:21.575 It has nothing for now, but over here at Outliner 260 00:17:22.377 --> 00:17:27.751 BP_Player, and 0 means that we have one of it created 261 00:17:27.751 --> 00:17:31.593 Meaning, we have one BP_Player being created automatically 262 00:17:32.197 --> 00:17:36.187 Of course, we will need to relocate it and all 263 00:17:37.088 --> 00:17:39.631 That's the basic setting we can have 264 00:17:39.631 --> 00:17:43.646 Whenever we start working on an Unreal project 265 00:17:43.646 --> 00:17:45.324 These are the things you need to do first 266 00:17:45.324 --> 00:17:50.795 So create a project, and create the basic Level 267 00:17:50.795 --> 00:17:55.629 And create a Game Mode Base for that Level 268 00:17:55.629 --> 00:17:59.927 And create a player and set it there 269 00:18:02.402 --> 00:18:07.785 And, since we are working on a shooter example 270 00:18:07.785 --> 00:18:09.275 We need something here, right? 271 00:18:09.800 --> 00:18:13.661 At this Level, we do not see anything for now 272 00:18:14.522 --> 00:18:17.304 And this is just like the 273 00:18:17.304 --> 00:18:21.903 The actual filming location 274 00:18:22.448 --> 00:18:24.812 You know, filming for a movie or a TV series 275 00:18:24.812 --> 00:18:28.201 You can consider this as the location for such 276 00:18:28.439 --> 00:18:32.115 Imagine that location has no source of light; of course it's all dark 277 00:18:32.739 --> 00:18:34.671 So what we need here is some light 278 00:18:35.473 --> 00:18:38.426 And with that light we will be able to see 279 00:18:38.426 --> 00:18:42.609 We also have a director who will be filming things with their camera 280 00:18:42.966 --> 00:18:47.867 Only through which the video result we watch is created 281 00:18:48.134 --> 00:18:52.179 Just like that, at Unreal Editor, we can start working on our project like so 282 00:18:52.516 --> 00:18:55.279 So let's first add some light source 283 00:18:55.279 --> 00:19:01.429 Here, we see Light on this third menu 284 00:19:02.280 --> 00:19:05.577 We have things like Directional Light, Point Light, and Spot Light 285 00:19:06.171 --> 00:19:07.379 Rect LIght as well 286 00:19:08.032 --> 00:19:12.199 We have some multiple kinds, which are 287 00:19:12.199 --> 00:19:15.405 To simplify, this is a direct lighting 288 00:19:15.405 --> 00:19:18.912 And by that, we usually mean the sun 289 00:19:18.912 --> 00:19:21.255 So this is like the sun 290 00:19:21.701 --> 00:19:24.941 Point Light is literally like the lightbulb 291 00:19:24.941 --> 00:19:27.157 See the icon here? 292 00:19:27.473 --> 00:19:30.816 So it's like a lamp or a lightbulb 293 00:19:30.816 --> 00:19:34.352 Which lights up around that source 294 00:19:34.857 --> 00:19:40.020 Spot Light has a direction, in a cone shape 295 00:19:41.148 --> 00:19:44.181 In terms of real life, it's like car headlights 296 00:19:44.399 --> 00:19:47.848 Or flashlight-like light sources 297 00:19:50.868 --> 00:19:53.410 And Rect Light is some source of light 298 00:19:53.410 --> 00:19:58.019 From any display, such as television 299 00:19:58.019 --> 00:20:02.251 And Sky is, obviously, the light from the sky 300 00:20:04.162 --> 00:20:08.403 Since we are going for a 2D-style shooter 301 00:20:08.403 --> 00:20:13.174 We only need this one Directional Light 302 00:20:15.228 --> 00:20:18.647 Let's use this Directional Light 303 00:20:18.647 --> 00:20:23.959 And we can set the location a bit 304 00:20:23.959 --> 00:20:30.446 In fact, in our project, the location of light does not really matter 305 00:20:30.446 --> 00:20:36.143 For sunlight, what matters more is in which direction it is pointing at 306 00:20:36.410 --> 00:20:38.771 So this rotation is what matters more 307 00:20:39.068 --> 00:20:41.891 So you can basically go with its default values 308 00:20:42.703 --> 00:20:43.725 Let's set it up here 309 00:20:45.517 --> 00:20:47.609 And now, we need a camera 310 00:20:47.609 --> 00:20:50.159 See here, Cinematic 311 00:20:53.165 --> 00:20:55.625 Or should we just search for a camera? 312 00:20:58.069 --> 00:20:59.788 Let's look for the cameras 313 00:21:00.531 --> 00:21:03.495 Camera, we have Camera Actor 314 00:21:03.961 --> 00:21:05.626 Let's place it here 315 00:21:07.676 --> 00:21:09.714 The camera looks like this 316 00:21:09.714 --> 00:21:13.069 And the direction is, I think this way is better 317 00:21:13.069 --> 00:21:16.479 To our bottom left, we have Gizmo 318 00:21:16.479 --> 00:21:22.629 Place it so that the direction of X at Gizmo is towards the inside of the screen 319 00:21:22.629 --> 00:21:26.018 So this is the optimal place here 320 00:21:27.117 --> 00:21:28.647 So the camera goes here 321 00:21:28.904 --> 00:21:31.108 Notice how this is a little tricky to place it 322 00:21:31.108 --> 00:21:33.346 For this, let's go to this Details 323 00:21:34.237 --> 00:21:36.601 And at Camera Actors 324 00:21:37.066 --> 00:21:40.475 At Details, go to Transform, Location 325 00:21:40.475 --> 00:21:43.124 Let's place everything at 0, 0, and 0 326 00:21:43.124 --> 00:21:45.045 And let's push it back a little 327 00:21:45.589 --> 00:21:47.871 We're pushing this a bit 328 00:21:48.495 --> 00:21:52.604 So I moved it by around 1000 329 00:21:52.604 --> 00:21:54.431 The measurement here is cm 330 00:21:54.600 --> 00:21:57.887 So 1000cm is around 10m 331 00:21:58.253 --> 00:21:59.928 Because 100cm is a meter 332 00:22:00.878 --> 00:22:03.382 So that's where it goes 333 00:22:04.560 --> 00:22:06.408 From the side, this is how it looks like 334 00:22:07.201 --> 00:22:11.032 Moving Player 335 00:22:11.400 --> 00:22:15.294 Let's now go to the place where our player will be born 336 00:22:15.294 --> 00:22:17.088 We haven't worked on our player yet 337 00:22:18.455 --> 00:22:21.744 Shall we place a cube here? 338 00:22:21.744 --> 00:22:23.702 Let's place a cube at this origin point 339 00:22:24.959 --> 00:22:26.344 Which is here 340 00:22:27.284 --> 00:22:29.608 Let's run it and we see this 341 00:22:31.242 --> 00:22:34.482 Notice how it doesn't look right, even with the camera being placed here 342 00:22:34.640 --> 00:22:38.653 The camera shoudl look liek this, but here, we see the preview screen here 343 00:22:38.653 --> 00:22:40.951 It should look like this, but it does not 344 00:22:41.169 --> 00:22:45.136 This is because, even for cameras 345 00:22:45.136 --> 00:22:49.845 It's only meaningful when this player uses that camera 346 00:22:50.479 --> 00:22:55.526 Meaning, there can be more than one Camera Actors in place 347 00:22:55.526 --> 00:22:57.542 There could be multiple 348 00:22:57.839 --> 00:23:02.235 So what matters then is which camera that player is using 349 00:23:02.958 --> 00:23:05.335 So click on this camera here 350 00:23:06.315 --> 00:23:10.674 And at Details, we have this 351 00:23:10.674 --> 00:23:14.147 Under Camera Settings, we have Projection Mode 352 00:23:14.880 --> 00:23:19.263 At Projection Mode, we have Perspective 353 00:23:19.263 --> 00:23:20.645 Which allows for persepctive 354 00:23:21.289 --> 00:23:23.502 And this Orthographic, 2D 355 00:23:23.839 --> 00:23:26.357 Orthographic projection, perspective projection 356 00:23:26.792 --> 00:23:29.935 Projection means how we display it 357 00:23:30.400 --> 00:23:35.612 And orthographic and perspective projection are a bit different 358 00:23:35.939 --> 00:23:37.249 So for these 359 00:23:39.617 --> 00:23:43.071 Let's talk about orthographic and perspective projection 360 00:23:43.071 --> 00:23:45.617 In simple terms, they are 361 00:23:45.617 --> 00:23:48.191 Perspective projection has the camera looking this way 362 00:23:48.735 --> 00:23:51.957 And we have a screen like this 363 00:23:51.957 --> 00:23:56.440 And this becomes a triangular pyramid 364 00:23:58.539 --> 00:24:01.239 Which is here, it looks like this at the back 365 00:24:01.239 --> 00:24:03.900 And what has filmed inside this space is 366 00:24:03.900 --> 00:24:08.489 Condensed into this screen, that's what it is 367 00:24:08.489 --> 00:24:13.463 Meaning, it brings in that perspective of what's closer and further away 368 00:24:13.463 --> 00:24:16.551 This shape here is called a frustum 369 00:24:19.488 --> 00:24:21.076 A rectangular pyramid should look like this 370 00:24:21.076 --> 00:24:24.448 Like so, and like this, right? 371 00:24:26.627 --> 00:24:31.465 Right? And here, this top part has been cut off like so 372 00:24:32.000 --> 00:24:41.901 And this is called a view frustum 373 00:24:42.829 --> 00:24:47.449 And that's for perspective projection 374 00:24:50.797 --> 00:24:52.188 And now for orthographic projection 375 00:24:55.800 --> 00:25:00.357 In simple terms, its final product looks like this 376 00:25:00.357 --> 00:25:02.369 And it just simply films this 377 00:25:04.698 --> 00:25:05.917 Like so 378 00:25:06.016 --> 00:25:09.416 So whether it is closer or further away 379 00:25:09.416 --> 00:25:12.176 Its size will look the same 380 00:25:13.077 --> 00:25:16.089 Since we are creating a 2D work 381 00:25:16.089 --> 00:25:18.779 Let's change this to Orthographic 382 00:25:19.819 --> 00:25:20.920 And now this looks much bigger 383 00:25:21.158 --> 00:25:25.896 Here Ortho Width is set to 512 384 00:25:26.163 --> 00:25:28.339 Let's double this value 385 00:25:28.339 --> 00:25:33.210 So doubling it is 1024, let's actually make it 1920 386 00:25:33.418 --> 00:25:36.755 Let's make it smaller like this 387 00:25:40.498 --> 00:25:41.848 And bringing it down 388 00:25:43.432 --> 00:25:47.330 This part is very important, at Auto Player Activation 389 00:25:47.330 --> 00:25:49.805 It is Disabled now 390 00:25:49.805 --> 00:25:55.044 This means whether the player will automatically activate this for use 391 00:25:55.618 --> 00:25:57.412 Open this, set to Player 0 392 00:25:58.234 --> 00:26:02.005 Player 0 is called Local Player 393 00:26:02.005 --> 00:26:05.673 You will be learning about multiplay at network 394 00:26:05.941 --> 00:26:10.441 Network has the concept of my computer, the server 395 00:26:11.421 --> 00:26:14.702 And someone else's computer 396 00:26:14.920 --> 00:26:18.940 So the player that I am in control in my computer 397 00:26:18.940 --> 00:26:20.743 That's a Local Player 398 00:26:21.000 --> 00:26:24.915 So Local Player is like this Player 0 399 00:26:24.915 --> 00:26:27.592 So Player 0 means me 400 00:26:27.592 --> 00:26:29.760 The player that I'm controlling 401 00:26:29.760 --> 00:26:34.866 So Player 0 is the one that is automatically activated in the beginning 402 00:26:34.866 --> 00:26:37.918 That's the placement we want for our camera 403 00:26:38.195 --> 00:26:41.834 Now run this, and notice how it's in the center here 404 00:26:43.468 --> 00:26:45.079 That was on setting the camera 405 00:26:46.306 --> 00:26:49.160 That was a simple process 406 00:26:49.160 --> 00:26:52.624 And then, since this is a cube 407 00:26:52.624 --> 00:26:57.374 We can now make our player do the same thing 408 00:26:58.424 --> 00:27:00.227 Save, and go to our BP_Player 409 00:27:02.078 --> 00:27:05.091 For our player, we have Components here; click on Add 410 00:27:05.893 --> 00:27:08.144 Here we have Cube 411 00:27:09.491 --> 00:27:10.758 Place it like this 412 00:27:13.608 --> 00:27:16.041 It looks like this, and save 413 00:27:17.744 --> 00:27:18.871 And run 414 00:27:21.208 --> 00:27:24.744 And place this at 0, 0, 0 to see this 415 00:27:24.744 --> 00:27:28.915 But its initial location is not 0, 0, 0, right? 416 00:27:28.915 --> 00:27:31.073 So we need to set this up as well 417 00:27:31.439 --> 00:27:35.342 Here, we have Player Start 418 00:27:35.342 --> 00:27:39.811 This means, when the player is initially created through Game Mode Base 419 00:27:39.811 --> 00:27:42.771 This is the location for that player 420 00:27:42.771 --> 00:27:46.039 So let's bring out Player Start Vector 421 00:27:46.593 --> 00:27:50.345 Place it at 0, 0, 0, and run it 422 00:27:51.157 --> 00:27:53.469 Now we see it on our screen 423 00:27:55.657 --> 00:27:57.135 Let's now move it around 424 00:27:57.274 --> 00:27:59.427 First we need to learn about the input process 425 00:28:00.625 --> 00:28:07.308 Here, on the top, let's go back to Project Setting 426 00:28:08.239 --> 00:28:11.218 And here, let's scroll down 427 00:28:12.387 --> 00:28:14.078 We have Input here 428 00:28:15.276 --> 00:28:18.376 Click on Input and see this 429 00:28:20.071 --> 00:28:21.606 We have Bindings 430 00:28:21.841 --> 00:28:25.425 At Bindings, we have two concepts 431 00:28:25.425 --> 00:28:26.493 See these two plus signs 432 00:28:26.493 --> 00:28:29.284 We have Action and Axis 433 00:28:29.601 --> 00:28:31.001 Axis is for the mapping 434 00:28:31.189 --> 00:28:34.045 So we can add things like vertical and horizontal axis 435 00:28:34.520 --> 00:28:39.120 And Action is literally the action 436 00:28:40.189 --> 00:28:43.145 For example, we can say 437 00:28:43.719 --> 00:28:48.762 For example, if pressing 'A' and 'D' on the keyboard moves the character 438 00:28:49.009 --> 00:28:50.933 We could use Action for that 439 00:28:50.933 --> 00:28:53.545 But basically, using Axis will be much more convenient 440 00:28:53.970 --> 00:29:01.192 So press 'A' to move to the left, and 'D' to the right 441 00:29:01.192 --> 00:29:05.573 And 'W' to north and 'S' to south, to realize this 442 00:29:05.910 --> 00:29:07.793 We usually use Axis 443 00:29:08.397 --> 00:29:11.474 I said left or right, but in fact it is 444 00:29:11.939 --> 00:29:15.603 Vertical or horizontal; that's the input for the concept 445 00:29:15.870 --> 00:29:20.720 And this Axis value, by multiplying it to the direction 446 00:29:20.968 --> 00:29:23.112 We create that final direction 447 00:29:23.439 --> 00:29:24.939 And we will be doing that here 448 00:29:25.493 --> 00:29:29.469 Click on Axis Mapping to add this 449 00:29:30.667 --> 00:29:31.246 Like so 450 00:29:32.186 --> 00:29:39.025 So this is the horizontal axis, let's name it 'Horizontal' 451 00:29:40.718 --> 00:29:44.112 And we can assign two buttons for that horizontal axis 452 00:29:44.429 --> 00:29:47.030 We could click to find, which is a lot of work 453 00:29:47.030 --> 00:29:51.680 So click on the button and assing 'A' and 'D' 454 00:29:51.680 --> 00:29:53.650 Press 'A' and it will become 'A' 455 00:29:54.155 --> 00:29:56.621 Press, 'D' and it will be 'D' 456 00:29:58.096 --> 00:30:01.041 'D' for right and 'A' for left 457 00:30:01.903 --> 00:30:09.079 The increasing axis value is a positive number, and the decreasing a negative 458 00:30:09.079 --> 00:30:13.693 So for Scale, since 'A' is left, let's make it -1 459 00:30:15.287 --> 00:30:21.467 This means, when we press D, the axis value for Horizontal becomes 1 460 00:30:22.714 --> 00:30:24.359 If we don't press anything, it remains 0 461 00:30:24.538 --> 00:30:27.020 And pressing 'A' it becomes -1 462 00:30:29.277 --> 00:30:30.680 Now, let's make another axis 463 00:30:30.898 --> 00:30:32.769 Let's make a 'Vertical' axis 464 00:30:34.977 --> 00:30:37.332 So now we have Horizontal and Vertical 465 00:30:38.005 --> 00:30:39.303 Same thing here 466 00:30:40.719 --> 00:30:45.735 Let's se 'W' and 'S' here 467 00:30:46.349 --> 00:30:50.762 'S' is the negative number, because that's what goes down 468 00:30:52.347 --> 00:30:54.125 So let's assing it like so 469 00:30:57.237 --> 00:30:59.560 After having created Horizontal and Vertical 470 00:31:00.273 --> 00:31:04.439 Now we can move to BP_Player for some coding 471 00:31:04.439 --> 00:31:07.224 I said Event Graph is where the coding happens, right? 472 00:31:07.620 --> 00:31:08.306 So let's move to this window 473 00:31:09.226 --> 00:31:13.406 Now, the control happens when the player actually moves 474 00:31:13.406 --> 00:31:17.330 So it's not something done once when it is born 475 00:31:17.330 --> 00:31:19.037 It is something that is has to continue to do so 476 00:31:19.037 --> 00:31:21.467 So let's work on Tick 477 00:31:22.754 --> 00:31:24.953 Let's work on it right here 478 00:31:25.824 --> 00:31:29.593 Then shall we start working with Horizontal? 479 00:31:31.157 --> 00:31:33.632 Search for Horizontal and we get two results 480 00:31:34.058 --> 00:31:36.833 One as Events and another as Values 481 00:31:37.150 --> 00:31:39.966 For these, let's try both 482 00:31:40.145 --> 00:31:42.877 Event is something we've already looked at 483 00:31:43.233 --> 00:31:44.158 It looks like this 484 00:31:44.158 --> 00:31:47.169 So this has that Execute Pin 485 00:31:47.555 --> 00:31:48.976 And next, for Values 486 00:31:51.388 --> 00:31:55.467 Values is in a Pure status, see? 487 00:31:55.467 --> 00:31:57.112 Remember that concept of Pure? 488 00:31:57.380 --> 00:32:00.315 It's Pure, which is appropriate for our case 489 00:32:00.315 --> 00:32:02.662 Since we are using it for our Tick, rather than getting the event 490 00:32:02.939 --> 00:32:05.309 And saving it somewhere to use it again 491 00:32:06.626 --> 00:32:11.485 It will be more convenient to bring in the value right away for use 492 00:32:11.970 --> 00:32:15.904 So let's do this, and let's bring in Vertical as well 493 00:32:18.088 --> 00:32:18.971 Let's choose Values 494 00:32:23.090 --> 00:32:28.149 At Unreal, I once talked about the concept of axis 495 00:32:28.149 --> 00:32:30.388 At Unreal, this is how the axis looks like 496 00:32:31.239 --> 00:32:34.402 We have three, this being the right 497 00:32:34.402 --> 00:32:41.794 This is Y, and this is front or X, and top or Z 498 00:32:42.328 --> 00:32:43.093 This is how it looks like 499 00:32:43.637 --> 00:32:46.048 So X, Y and Z are placed 500 00:32:46.048 --> 00:32:48.225 The direction of the axis looks like this 501 00:32:48.838 --> 00:32:52.590 And we can set the direction based on this 502 00:32:53.600 --> 00:32:55.824 So now, let's create its direction 503 00:32:55.824 --> 00:32:58.719 The data type for direction is Vector 504 00:32:58.719 --> 00:33:01.918 So let's search for Make Vector 505 00:33:03.849 --> 00:33:04.953 We have X, Y and Z 506 00:33:05.359 --> 00:33:09.839 I said that horizontal is the Y axis, right? 507 00:33:11.087 --> 00:33:14.375 So let's add that horizontal part to this Y 508 00:33:14.642 --> 00:33:16.843 And vertical is Z 509 00:33:16.843 --> 00:33:18.686 So Vertical goes to Z 510 00:33:19.280 --> 00:33:22.585 Now we have that yellow Vector data type 511 00:33:22.852 --> 00:33:24.365 To create that value 512 00:33:24.880 --> 00:33:27.086 So we can move this direction 513 00:33:29.086 --> 00:33:31.034 Here, we have a very important concept 514 00:33:31.034 --> 00:33:35.966 In physics, we have equations of motion 515 00:33:36.560 --> 00:33:38.255 Which will be used here 516 00:33:38.997 --> 00:33:48.504 The equation for motion is P = P0 vt 517 00:33:49.058 --> 00:33:51.836 P here is actually an L for location 518 00:33:51.925 --> 00:33:56.160 But in Physics, P for position is more often used 519 00:33:56.160 --> 00:33:58.067 While Unreal uses L for location 520 00:33:58.354 --> 00:34:01.044 So it's the same thing but meaning Position 521 00:34:01.400 --> 00:34:04.094 Position and Location are like same concepts 522 00:34:05.302 --> 00:34:09.541 So based on the equation sign, the one on right is done first 523 00:34:09.541 --> 00:34:11.467 And then moved over to the left 524 00:34:11.725 --> 00:34:17.008 So these are the same P's, but this is the final location 525 00:34:20.919 --> 00:34:21.847 Equals to the current location 526 00:34:25.999 --> 00:34:29.419 Plus, V here is for velocity 527 00:34:31.280 --> 00:34:32.978 V for velocity 528 00:34:36.439 --> 00:34:37.835 Velocity 529 00:34:39.261 --> 00:34:42.994 And the multiplication, which is omitted here 530 00:34:43.241 --> 00:34:45.816 So multiplied by t 531 00:34:46.103 --> 00:34:49.239 And t here is the Delta time 532 00:34:49.239 --> 00:34:53.339 It's a Delta time caleld Delta Seconds 533 00:34:54.834 --> 00:34:57.399 So this is the equation here 534 00:34:57.399 --> 00:35:07.124 And to break down even more, velocity is direciton multiplied by speed 535 00:35:07.679 --> 00:35:10.486 Multiplied by speed 536 00:35:12.080 --> 00:35:15.498 Sometimes in Korean dictionaries 537 00:35:15.498 --> 00:35:18.093 They use velocity and speed interchangeably 538 00:35:18.776 --> 00:35:21.319 But here I am distinguishing the two 539 00:35:21.666 --> 00:35:24.561 So velocity is a Vector 540 00:35:24.561 --> 00:35:27.320 I haven't labelled them here, but these are all Vectors 541 00:35:28.439 --> 00:35:31.110 All Vectors, except for the 't' here 542 00:35:31.318 --> 00:35:32.213 This is a Vector 543 00:35:33.381 --> 00:35:34.839 Velocity is a Vector too 544 00:35:34.839 --> 00:35:38.238 Velocity meaning direction and speed 545 00:35:40.875 --> 00:35:43.066 So shall we work on it first? 546 00:35:44.116 --> 00:35:47.332 I will have more chance to explain things like Vector 547 00:35:47.837 --> 00:35:49.572 Now let's move with this 548 00:35:50.711 --> 00:35:51.957 Let's frst bring in the current location 549 00:35:51.957 --> 00:35:54.157 Let me do this here first 550 00:35:54.157 --> 00:36:00.607 P = P0 vt 551 00:36:01.350 --> 00:36:04.848 So this here is the direction 552 00:36:05.838 --> 00:36:08.238 This part is 'Direction' 553 00:36:10.357 --> 00:36:11.617 And, though I haven't written it here 554 00:36:17.357 --> 00:36:19.439 This here is the direction 555 00:36:24.724 --> 00:36:27.923 Meaning, we now need one for speed 556 00:36:27.923 --> 00:36:29.750 Let's create a variable 557 00:36:31.136 --> 00:36:33.646 'Speed', the variable is a float type 558 00:36:34.745 --> 00:36:36.198 Let's call it 'Speed' 559 00:36:39.308 --> 00:36:43.531 Compile, and I want it to move 5m a second 560 00:36:43.531 --> 00:36:46.014 500 is 5m 561 00:36:46.628 --> 00:36:47.659 So let's add that 562 00:36:48.828 --> 00:36:50.888 Let's now bring in our Speed 563 00:36:50.888 --> 00:36:53.971 So adding these two is our Velocity 564 00:36:54.882 --> 00:36:57.985 Direction multiplied by Speed 565 00:36:59.589 --> 00:37:06.374 Let's multiply them, this and Velocity, that's how it works 566 00:37:12.847 --> 00:37:15.905 So what is this again? this is for 'v' 567 00:37:18.367 --> 00:37:20.326 T is, it is set to Delta Seconds here 568 00:37:20.326 --> 00:37:21.998 We multiply this as well 569 00:37:22.602 --> 00:37:27.575 So this and go for Multiply 570 00:37:28.317 --> 00:37:29.475 Oh, we need to multiply this first 571 00:37:29.475 --> 00:37:35.575 Let's do Vector first and then multiply Float like so 572 00:37:36.476 --> 00:37:39.722 So this is the 'vt' part of the equation 573 00:37:40.297 --> 00:37:42.306 Now we need the current location, or position 574 00:37:42.306 --> 00:37:45.523 For that, we can add the current location of our Actor 575 00:37:45.860 --> 00:37:50.178 So 'Get Actor Location' 576 00:37:52.120 --> 00:37:53.233 This is our P0 577 00:37:53.451 --> 00:37:54.874 So we add this and this 578 00:37:54.874 --> 00:37:58.394 Adding the two will complete the equation 579 00:37:58.919 --> 00:38:03.609 Let's add these using Add 580 00:38:06.520 --> 00:38:08.646 I'm working in the order of the equation 581 00:38:09.280 --> 00:38:11.634 Direction, and Speed 582 00:38:12.248 --> 00:38:16.551 And Detal Time, the 't' part, multiplied 583 00:38:17.967 --> 00:38:24.330 So this is our 'vt', these two multiplied together 584 00:38:24.509 --> 00:38:28.522 And we have 'Get Actor Location', to add our P0 585 00:38:28.522 --> 00:38:30.922 So we're combining these two, and finally we Set 586 00:38:31.219 --> 00:38:35.889 Set Actor Location to add them 587 00:38:37.879 --> 00:38:40.738 Now, the new Position is this 588 00:38:41.293 --> 00:38:44.391 Now let's connect that Execute Pin 589 00:38:45.708 --> 00:38:50.038 Now, shall we see it? Run 590 00:38:51.354 --> 00:38:55.437 Press 'A', 'D', 'W', and 'S' to move it around 591 00:38:57.728 --> 00:38:59.804 Now we can move the player around 592 00:39:00.289 --> 00:39:06.483 But just as it is now, it doesn't look too right because 593 00:39:06.879 --> 00:39:11.231 I don't know if you can tell, but the movement of pressing one key 594 00:39:11.865 --> 00:39:15.318 And that of pressing two keys, such as 'W' and 'D', is different 595 00:39:16.041 --> 00:39:17.939 The diagonal movement is a little faster 596 00:39:17.939 --> 00:39:23.116 This is because, for this we need to understand more about Vector 597 00:39:23.116 --> 00:39:24.817 Let me write it out here 598 00:39:25.748 --> 00:39:30.112 If we press 'W', we have created a Vector that looks like this 599 00:39:30.449 --> 00:39:33.817 Which has the size of 1 600 00:39:35.540 --> 00:39:38.810 This is W, and this is A, let's call it our Vector A 601 00:39:38.810 --> 00:39:43.110 And when we press 'D', we now get this Vector 602 00:39:44.506 --> 00:39:46.211 Whose size is also 1 603 00:39:47.548 --> 00:39:48.632 Let's call it 'B' 604 00:39:49.582 --> 00:39:52.646 So when we press 'W' and 'D' at the same time 605 00:39:52.646 --> 00:39:54.390 It adds these two 606 00:39:54.390 --> 00:39:57.641 And adding two Vectors is usually a rectangular format 607 00:39:58.226 --> 00:40:02.179 Meaning, this Vector below stays here 608 00:40:03.149 --> 00:40:05.955 And this Vector here is added right here 609 00:40:05.955 --> 00:40:07.993 Something like this 610 00:40:08.280 --> 00:40:11.322 And a line connects to that point 611 00:40:11.914 --> 00:40:13.102 This line doesn't look too straight 612 00:40:13.411 --> 00:40:14.865 So we connect these points 613 00:40:16.498 --> 00:40:21.000 Like this, and this becomes the C Vector 614 00:40:21.000 --> 00:40:27.480 C=A B, it's all Vectors, like this 615 00:40:30.178 --> 00:40:34.517 So A B becomes C Vector 616 00:40:34.517 --> 00:40:37.395 But look at the size, this is bigger 617 00:40:37.395 --> 00:40:40.094 Because, when we draw a circle 618 00:40:40.639 --> 00:40:43.183 Let's say that there's a circle 619 00:40:43.183 --> 00:40:45.409 Which is 1m in size 620 00:40:46.439 --> 00:40:50.543 This circle does not look too perfect, but let's move on 621 00:40:50.543 --> 00:40:53.243 So adding this looks like this 622 00:40:53.520 --> 00:40:56.323 This is the Vector, which is longer by this much 623 00:40:57.244 --> 00:41:00.008 Because it's 1 only up until here, right? 624 00:41:00.008 --> 00:41:02.322 This is longer by this much 625 00:41:02.748 --> 00:41:05.921 With that, if we are multiplying it by any Speed 626 00:41:06.277 --> 00:41:07.530 Its size will get even bigger 627 00:41:07.530 --> 00:41:11.281 This is what the Pythagorian theorm explains 628 00:41:11.281 --> 00:41:12.793 Which is expressed by this 629 00:41:13.239 --> 00:41:18.223 The square of C is equal to the square of A plus the square of B 630 00:41:20.399 --> 00:41:22.626 Meaning, we can add a square root on each end like so 631 00:41:23.557 --> 00:41:27.438 So here, A is 1, B is 1, and the square of 1 is 1 632 00:41:27.438 --> 00:41:33.228 So this becomes the square root of 2, which is the square root of C squared 633 00:41:36.526 --> 00:41:39.739 Then C is, this is C, square root of 2 634 00:41:40.412 --> 00:41:41.637 Meaning, C is equal to square root of 2 635 00:41:43.628 --> 00:41:46.435 So what is square root of 2? 1.4 something 636 00:41:46.435 --> 00:41:48.981 Which is bigger than one 637 00:41:49.456 --> 00:41:52.323 Much bigger, actually; that's why moving diagonally 638 00:41:52.996 --> 00:41:54.593 Will make you move faster 639 00:41:55.732 --> 00:41:58.818 So we need to now fix this 640 00:41:59.600 --> 00:42:03.627 What we can do is, we can set Vector 641 00:42:08.840 --> 00:42:10.807 To have its size as 1 642 00:42:12.879 --> 00:42:13.836 We need to do this 643 00:42:13.836 --> 00:42:15.620 Which is an easy task 644 00:42:15.620 --> 00:42:18.474 This work is called Normalize 645 00:42:18.474 --> 00:42:20.397 Normalizing the Vector 646 00:42:23.971 --> 00:42:27.308 And we use the term normalize 647 00:42:28.199 --> 00:42:31.304 To normalize 648 00:42:32.007 --> 00:42:33.509 And we can normalize this as well 649 00:42:34.044 --> 00:42:38.637 Let's move over here, and this is where it gets bigger 650 00:42:39.934 --> 00:42:43.850 So we need to normalize this area here 651 00:42:45.008 --> 00:42:46.582 Look for 'Normalize' 652 00:42:48.226 --> 00:42:50.917 Let's add it like so 653 00:42:56.219 --> 00:42:58.349 Compile and run 654 00:42:59.517 --> 00:43:02.552 Now the diagonal movement has the same 655 00:43:03.215 --> 00:43:06.619 Or at least not too different speed 656 00:43:08.748 --> 00:43:11.508 I was moving a little fast and 657 00:43:11.508 --> 00:43:14.225 I should go back to Vector and talk about it a little more 658 00:43:14.225 --> 00:43:15.766 Let me summarize it again 659 00:43:16.528 --> 00:43:19.379 So what is Vector again? Vector 660 00:43:21.879 --> 00:43:31.561 A Vector has its direction and size 661 00:43:31.660 --> 00:43:32.387 That is a Vector 662 00:43:32.387 --> 00:43:34.619 For example, let's say we have this car 663 00:43:36.837 --> 00:43:41.020 Which can run 200km an hour 664 00:43:41.020 --> 00:43:42.778 So is that the Vector? 665 00:43:43.897 --> 00:43:47.048 What is always paired with Vector is Scalar 666 00:43:48.919 --> 00:43:52.422 Scalar is the physical quantity for a size 667 00:43:53.442 --> 00:43:55.588 So is this Scalar or Vector? 668 00:43:56.479 --> 00:43:59.126 Of course Scalar, since this has no direction 669 00:43:59.779 --> 00:44:01.024 Or another example is 670 00:44:01.529 --> 00:44:04.882 There's this wind, and this is East 671 00:44:05.317 --> 00:44:10.029 It's an East wind, 3m an hour, a very strong wind 672 00:44:10.029 --> 00:44:12.921 So is this East wind a Vector? 673 00:44:15.000 --> 00:44:16.059 Yes, this is Vector 674 00:44:17.821 --> 00:44:20.540 Because we have that direciton, East, as well as its size 675 00:44:20.540 --> 00:44:22.218 So this is Vector 676 00:44:23.179 --> 00:44:25.189 And Vector has a characteristic where 677 00:44:25.189 --> 00:44:28.149 It's the same Vector if it has the same size and direction 678 00:44:28.416 --> 00:44:30.575 Or, to be precise 679 00:44:31.199 --> 00:44:33.011 Let's say we have a Vector that looks like this 680 00:44:33.357 --> 00:44:36.209 So this Vector 'A' and 'B' are the same Vectors 681 00:44:37.159 --> 00:44:38.132 The same Vectors 682 00:44:38.518 --> 00:44:43.323 With the same direction and size, they are the same Vectors 683 00:44:43.630 --> 00:44:48.390 This may be an abstract concept for now, but that's how it works 684 00:44:48.390 --> 00:44:50.413 So we tried using some physics equations 685 00:44:50.809 --> 00:44:53.357 To move our object around 686 00:44:55.080 --> 00:44:58.832 Let's summarize the chapter 687 00:44:59.548 --> 00:45:01.190 Initiating Prototyping Environment 688 00:45:01.190 --> 00:45:03.734 Creating Shooter Project Create Level, Save with the name 'MainMap', go to Project Settings, Maps & Modes, set it as the default map 689 00:45:03.734 --> 00:45:06.439 Creating Game Mode Base Create GameModeBase Blueprint, which contains basic rules and settings for the play at each Level 690 00:45:06.439 --> 00:45:09.539 Moving Player To move Player Create Player Blueprint, bind user input 691 00:45:09.539 --> 00:45:12.289 Player Movement To process the movement, receive horizontal and vertical inputs to create Get Horizontal and Get Vertical vectors 692 00:45:12.289 --> 00:45:14.340 Connect Normalize Node to keep the vector size as 1 even for diagonal movements