WEBVTT 1 00:00:04.240 --> 00:00:08.992 Realistic Basics Using Unreal Engine Blueprints 2 00:00:08.992 --> 00:00:11.517 GCC Academy 3 00:00:27.366 --> 00:00:28.515 Hello 4 00:00:28.515 --> 00:00:32.183 I am Tak Gwang-wook, in charge of the Blueprint lecture 5 00:00:32.183 --> 00:00:34.483 This time, we will create a simple function 6 00:00:34.483 --> 00:00:37.381 using Blueprint 7 00:00:37.381 --> 00:00:41.153 In this session, we will learn about the series of methods 8 00:00:41.153 --> 00:00:43.846 for designing a function through a practical example 9 00:00:43.846 --> 00:00:46.396 verifying whether the designed work works properly 10 00:00:46.396 --> 00:00:49.006 and finally completing the function 11 00:00:49.327 --> 00:00:53.277 Role and Mechanism of Collision 12 00:00:53.500 --> 00:00:58.350 This time, I will create a simple function 13 00:00:58.350 --> 00:01:02.252 using the basic blueprint theorywe learned earlier 14 00:01:02.252 --> 00:01:05.500 The function is as follows: There is a white platform 15 00:01:05.500 --> 00:01:09.500 When the player steps on this white platform 16 00:01:09.500 --> 00:01:12.700 this white platform becomes a button 17 00:01:12.700 --> 00:01:19.975 that opens the door in front of it 18 00:01:19.975 --> 00:01:22.500 To do this, we need to prepare a few things 19 00:01:22.500 --> 00:01:26.243 First, I think we need to install the door 20 00:01:26.243 --> 00:01:30.500 We'll use the asset in StarterContent for the door 21 00:01:30.500 --> 00:01:32.150 In the Content Drawer 22 00:01:32.150 --> 00:01:36.180 you will see a folder called StarterContent 23 00:01:36.180 --> 00:01:39.630 This is included when you create a project 24 00:01:39.630 --> 00:01:42.880 and you can set 25 00:01:42.880 --> 00:01:44.500 whether to install it 26 00:01:44.500 --> 00:01:47.500 If you don't have it and didn't set it 27 00:01:47.500 --> 00:01:51.807 then click this + button, and at the top 28 00:01:51.807 --> 00:01:54.457 you will see an item called 29 00:01:54.457 --> 00:01:55.718 Add Feature or Content Pack 30 00:01:55.718 --> 00:01:59.368 If you click this item, you can add 31 00:01:59.368 --> 00:02:00.500 various content items 32 00:02:00.500 --> 00:02:03.500 Among them, there is an item called Content 33 00:02:03.500 --> 00:02:06.173 If you look here, you will see Starter Content 34 00:02:06.173 --> 00:02:07.923 If you select this Starter Content 35 00:02:07.923 --> 00:02:10.054 and click Add to Project 36 00:02:10.054 --> 00:02:13.896 the StarterContent folder we saw earlier will be created 37 00:02:13.896 --> 00:02:18.777 and you can use various assets inside it 38 00:02:18.777 --> 00:02:22.427 If you look inside, there is an item called Props 39 00:02:22.427 --> 00:02:24.143 You will see various assets 40 00:02:24.143 --> 00:02:28.500 Among them, you will see an asset called SM_Door 41 00:02:28.500 --> 00:02:33.916 Let's try placing the assets 42 00:02:33.916 --> 00:02:37.589 We want to put a platform in the middle here 43 00:02:37.589 --> 00:02:41.520 and when the player presses this platform 44 00:02:41.520 --> 00:02:45.074 we're going to make it rotate on the Z axis like this 45 00:02:48.480 --> 00:02:52.767 When we press the play button, if we play like this 46 00:02:52.767 --> 00:02:56.067 the character doesn't come out like this 47 00:02:56.067 --> 00:02:58.262 It can only move around like this 48 00:02:58.262 --> 00:03:00.906 We want to control the character directly 49 00:03:00.906 --> 00:03:03.955 and have the character press the button 50 00:03:03.955 --> 00:03:06.500 but since the character doesn't come out right now 51 00:03:06.500 --> 00:03:10.213 we need to install a system that makes the character come out 52 00:03:10.213 --> 00:03:13.074 It comes out like this because it wasn't created 53 00:03:13.074 --> 00:03:15.500 in third-person mode when it was first created 54 00:03:15.500 --> 00:03:20.431 so this system wasn't automatically installed 55 00:03:20.431 --> 00:03:23.906 To do that, first cancel 56 00:03:23.906 --> 00:03:28.035 and click the Add button 57 00:03:28.035 --> 00:03:29.500 at the top of the Content Drawer 58 00:03:29.500 --> 00:03:33.500 and then click Add Feature or Content Pack 59 00:03:33.500 --> 00:03:35.767 You've clicked on our content a little while ago 60 00:03:35.767 --> 00:03:37.500 Here, the Blueprint items 61 00:03:37.500 --> 00:03:39.747 are organized in a way that allows you 62 00:03:39.747 --> 00:03:42.500 to install multiple modes 63 00:03:42.500 --> 00:03:46.015 Even if we didn't select this 64 00:03:46.015 --> 00:03:48.025 before creating the project 65 00:03:48.025 --> 00:03:51.500 we don't have to create the project again 66 00:03:51.500 --> 00:03:55.173 We can add them additionally like this 67 00:03:55.173 --> 00:03:57.500 We can simply click on Third Person 68 00:03:57.500 --> 00:03:59.817 and Add to Project 69 00:03:59.817 --> 00:04:03.233 and you can see that it is installed like this 70 00:04:03.233 --> 00:04:07.153 The Content Browser pops up separately 71 00:04:07.153 --> 00:04:09.044 Close it again 72 00:04:09.044 --> 00:04:11.648 and click on Content Drawer 73 00:04:11.648 --> 00:04:13.500 Now, several folders will be created 74 00:04:13.500 --> 00:04:16.183 A Characters folder, LevelPrototyping 75 00:04:16.183 --> 00:04:19.500 and a folder called Third Person will be created 76 00:04:19.500 --> 00:04:22.500 This way, it's not applied right away 77 00:04:22.500 --> 00:04:24.708 when you play 78 00:04:24.708 --> 00:04:27.213 You need to make some settings 79 00:04:27.213 --> 00:04:31.500 If you go to Edit, Project Settings 80 00:04:31.500 --> 00:04:33.876 and look on the left, you'll see Maps&Modes 81 00:04:33.876 --> 00:04:36.500 in the project items 82 00:04:36.500 --> 00:04:39.500 You can change this mode 83 00:04:39.500 --> 00:04:41.500 in the Maps&Modes item 84 00:04:41.500 --> 00:04:45.500 Here, you can change it to the Third Person mode 85 00:04:45.500 --> 00:04:47.243 we received 86 00:04:47.243 --> 00:04:49.500 Click GameModeBase 87 00:04:49.500 --> 00:04:50.500 If you look at the top 88 00:04:50.500 --> 00:04:53.896 there's an item called BP_ThirdPersonGameMode 89 00:04:53.896 --> 00:04:56.856 If you select this item 90 00:04:56.856 --> 00:04:59.757 you'll see that the ones below 91 00:04:59.757 --> 00:05:02.698 will be applied automatically 92 00:05:02.698 --> 00:05:04.728 If this is applied 93 00:05:04.728 --> 00:05:06.500 if you close the Project Settings window 94 00:05:06.500 --> 00:05:08.500 and play again 95 00:05:08.500 --> 00:05:12.500 the character will appear like this 96 00:05:12.500 --> 00:05:14.500 The point where the character appears 97 00:05:14.500 --> 00:05:16.500 is marked with this flag 98 00:05:16.500 --> 00:05:19.500 This is an actor called PlayerStart 99 00:05:19.500 --> 00:05:21.866 and this actor 100 00:05:21.866 --> 00:05:24.054 specifies where 101 00:05:24.054 --> 00:05:27.876 the character appears 102 00:05:27.876 --> 00:05:29.500 So when you play 103 00:05:29.500 --> 00:05:31.500 the character appears here 104 00:05:31.500 --> 00:05:35.173 If you move this PlayerStart location 105 00:05:35.173 --> 00:05:38.243 to the back like this 106 00:05:38.243 --> 00:05:40.718 when you play, you can see the character 107 00:05:40.718 --> 00:05:45.005 created a little further back than that location 108 00:05:45.005 --> 00:05:48.205 Then, you can see the character appear 109 00:05:48.205 --> 00:05:51.440 a little bit away from the door 110 00:05:51.440 --> 00:05:53.440 I think it's okay to put it a little bit further back 111 00:05:53.440 --> 00:05:55.120 I'll put it a little bit further back 112 00:05:55.120 --> 00:06:00.120 If you put it like this and play, you can see that 113 00:06:00.120 --> 00:06:03.080 it starts a little bit further away 114 00:06:03.080 --> 00:06:04.880 Now we're ready 115 00:06:04.880 --> 00:06:07.799 The door and player are ready 116 00:06:07.799 --> 00:06:11.959 so let's create a button blueprint that can open the door 117 00:06:11.959 --> 00:06:14.091 Let's open Content Drawer again 118 00:06:14.091 --> 00:06:17.720 and create it inside this BP folder 119 00:06:17.720 --> 00:06:22.639 Right click, click Blueprint Class 120 00:06:22.639 --> 00:06:26.599 This time, I will inherit the actor class 121 00:06:26.599 --> 00:06:29.400 to place it at this level 122 00:06:29.400 --> 00:06:32.200 So click on the actor 123 00:06:32.200 --> 00:06:36.840 name it BP_Door 124 00:06:36.840 --> 00:06:40.799 Double click to go into the blueprint 125 00:06:40.799 --> 00:06:45.880 Again, this panel will be attached next to the level like this 126 00:06:45.880 --> 00:06:49.400 and Basic is not needed, so let's close it 127 00:06:49.400 --> 00:06:52.760 First, let's make the appearance a little simpler 128 00:06:52.760 --> 00:06:56.510 First, to express that this is a button 129 00:06:56.510 --> 00:06:57.720 on the floor 130 00:06:57.720 --> 00:07:01.839 I will create a button using a simple box 131 00:07:01.839 --> 00:07:04.160 It's not an actual button you press 132 00:07:04.160 --> 00:07:07.060 but I think it's good to think of it 133 00:07:07.060 --> 00:07:10.720 as a visual representation that says, "This is a stepping stone" 134 00:07:10.720 --> 00:07:13.639 So, if you press the + button in Components 135 00:07:13.639 --> 00:07:16.439 and search for Cube 136 00:07:16.439 --> 00:07:19.440 you can pull out a cube shape like this 137 00:07:19.440 --> 00:07:21.879 I'll click on it to pull out a cube 138 00:07:21.879 --> 00:07:28.760 This is a component that gives it a cube-shaped appearance 139 00:07:28.760 --> 00:07:32.320 It simply takes care of the appearance 140 00:07:32.320 --> 00:07:35.070 And here, there's a Static Mesh 141 00:07:35.070 --> 00:07:38.146 called Cube 142 00:07:38.146 --> 00:07:42.199 which has a square shape like this 143 00:07:42.199 --> 00:07:46.800 I will change this square shape a little bit and make it flat 144 00:07:46.800 --> 00:07:52.960 If I make it flat like this, around 0.1 on the Z-axis 145 00:07:52.960 --> 00:07:58.523 I'll make it flat like this, around 0.05 146 00:07:58.523 --> 00:08:01.600 Let's make it flat like this 147 00:08:01.600 --> 00:08:06.300 This will create a simple mark that 148 00:08:06.300 --> 00:08:08.839 the character can step on 149 00:08:08.839 --> 00:08:12.539 Next, the platform called the cube 150 00:08:12.539 --> 00:08:15.399 is not directly pressed 151 00:08:15.399 --> 00:08:18.399 I said it is not directly pressed 152 00:08:18.399 --> 00:08:21.899 but it is just indicated as a location 153 00:08:21.899 --> 00:08:24.600 where you can press 154 00:08:24.600 --> 00:08:28.360 The concept that we move the character, stand on this platform 155 00:08:28.360 --> 00:08:31.110 and press this platform 156 00:08:31.110 --> 00:08:34.960 is actually because there is an area 157 00:08:34.960 --> 00:08:38.360 that can detect a character 158 00:08:38.360 --> 00:08:42.320 When the character enters that space and collides 159 00:08:42.320 --> 00:08:46.020 when the overlap occurs 160 00:08:46.020 --> 00:08:50.160 it can be seen as a pressed event 161 00:08:50.160 --> 00:08:54.080 So, the important thing is that there needs to be an area 162 00:08:54.080 --> 00:08:57.679 that the character can collide with 163 00:08:57.679 --> 00:09:00.160 So, that area that can collide with the character 164 00:09:00.160 --> 00:09:02.760 and cause the character to collide 165 00:09:02.760 --> 00:09:05.320 This area is called 166 00:09:05.320 --> 00:09:07.880 Collision 167 00:09:07.880 --> 00:09:10.160 So we need to install Collision 168 00:09:10.160 --> 00:09:13.679 Likewise, if you click the + button in Components 169 00:09:13.679 --> 00:09:19.520 and search for Collision 170 00:09:19.520 --> 00:09:23.119 you can pull out various types of Collisions 171 00:09:23.119 --> 00:09:28.399 I'll choose Box Collision among them 172 00:09:28.399 --> 00:09:33.679 I'll just name it Box 173 00:09:33.679 --> 00:09:37.199 If you create a Box Collision component like this 174 00:09:37.199 --> 00:09:41.399 you can see that a shape with 175 00:09:41.399 --> 00:09:43.960 only a yellow wireframe is created 176 00:09:43.960 --> 00:09:47.240 This means the area 177 00:09:47.240 --> 00:09:53.080 It indicates the collision area 178 00:09:53.080 --> 00:09:55.520 This area can be raised 179 00:09:55.520 --> 00:09:59.448 using the size or scale 180 00:09:59.448 --> 00:10:04.320 or there is an item called Box Extent below it 181 00:10:04.320 --> 00:10:09.760 You can adjust the value using this Box Extent 182 00:10:09.760 --> 00:10:12.040 Let's adjust it a little to fit the size 183 00:10:12.040 --> 00:10:16.685 Let's set it to about 50 184 00:10:16.685 --> 00:10:20.040 and 50, 50 185 00:10:20.040 --> 00:10:26.320 Then, it will almost match the white box shape below 186 00:10:26.320 --> 00:10:32.799 And let's install it above so that it doesn't go out 187 00:10:32.799 --> 00:10:35.519 If you mark the area like this 188 00:10:35.519 --> 00:10:40.079 when the character sees this white stepping stone and steps on it 189 00:10:40.079 --> 00:10:46.119 the character overlaps this Collision Box 190 00:10:46.119 --> 00:10:50.399 When it recognizes that the character has entered this area 191 00:10:50.399 --> 00:10:57.239 the door will open based on that recognition 192 00:10:57.239 --> 00:11:02.519 Then, the user will think that they pressed the stepping stone 193 00:11:02.519 --> 00:11:06.720 So you can think of this area as a space that recognizes 194 00:11:06.720 --> 00:11:08.870 that the character has entered this space 195 00:11:08.870 --> 00:11:11.559 a detection space 196 00:11:11.559 --> 00:11:13.160 That's Collision 197 00:11:13.160 --> 00:11:19.160 First, let's put the appearance like this, compile it, save it 198 00:11:19.160 --> 00:11:21.359 and install it here 199 00:11:21.359 --> 00:11:24.459 I'll drag and drop the blueprint 200 00:11:24.459 --> 00:11:28.440 from the Content Drawer and place it like this 201 00:11:28.440 --> 00:11:32.000 When I place it like this, you can see that it is expressed 202 00:11:32.000 --> 00:11:35.850 together with the white platform 203 00:11:35.850 --> 00:11:37.440 and the yellow collision area 204 00:11:37.440 --> 00:11:39.582 Then, when the character comes to 205 00:11:39.582 --> 00:11:42.480 step on the platform 206 00:11:42.480 --> 00:11:46.000 let's output "Detected" just like 207 00:11:46.000 --> 00:11:49.200 we output "Hello World" 208 00:11:49.200 --> 00:11:53.320 to check whether it is detected and works well 209 00:11:53.320 --> 00:11:55.920 Go back to BP_Door 210 00:11:55.920 --> 00:11:59.440 This time, we need to create an output function 211 00:11:59.440 --> 00:12:02.000 so, we have to go to the Event Graph item at the top 212 00:12:02.000 --> 00:12:03.348 Click Event Graph 213 00:12:06.519 --> 00:12:08.969 First, Print String 214 00:12:08.969 --> 00:12:12.359 Select 215 00:12:12.359 --> 00:12:14.799 the Print String node 216 00:12:14.799 --> 00:12:17.199 I'll set it to output "Detected" 217 00:12:17.199 --> 00:12:21.440 in this Print String node 218 00:12:21.440 --> 00:12:23.640 I'll set like this 219 00:12:23.640 --> 00:12:26.640 Where should I connect this node? 220 00:12:26.640 --> 00:12:29.279 Which event node should I connect it to? 221 00:12:29.279 --> 00:12:37.040 When it starts? When it's alive? Or when it overlaps with an actor? 222 00:12:37.040 --> 00:12:41.559 Of course, it's when it overlaps with an actor 223 00:12:41.559 --> 00:12:45.320 This Collision that we created 224 00:12:45.320 --> 00:12:50.760 is related to this ActorBeginOverlap 225 00:12:50.760 --> 00:12:54.878 In other words, BeginOverlap, this node 226 00:12:54.880 --> 00:12:58.030 tells this blueprint to generate 227 00:12:58.030 --> 00:13:01.480 an event when it overlaps 228 00:13:01.480 --> 00:13:06.239 with some external actor 229 00:13:06.239 --> 00:13:09.559 How do you detect that there's an overlap? 230 00:13:09.559 --> 00:13:14.640 That's the role of this box, Collision 231 00:13:14.640 --> 00:13:16.990 When the Collision and the character overlap 232 00:13:16.990 --> 00:13:19.411 that's when 233 00:13:19.411 --> 00:13:22.561 ActorBeginOverlap occurs 234 00:13:22.561 --> 00:13:25.839 and is executed 235 00:13:25.839 --> 00:13:29.739 So if we connect the execution pin of 236 00:13:29.739 --> 00:13:33.040 this ActorBeginOverlap to Print String like this 237 00:13:33.040 --> 00:13:36.959 the Print String node will be executed 238 00:13:36.959 --> 00:13:41.239 when the actor hits the Collision 239 00:13:41.239 --> 00:13:42.079 Let's take a look 240 00:13:42.079 --> 00:13:47.760 Compile, save, come back and play 241 00:13:47.760 --> 00:13:50.839 As you can see now, there's a character like this 242 00:13:50.839 --> 00:13:53.239 Let's go to this platform 243 00:13:53.239 --> 00:13:55.540 When you go like this 244 00:13:55.540 --> 00:13:58.679 do you see the phrase "Detected" appear in the upper left? 245 00:13:58.679 --> 00:14:02.440 I'll make it a little longer 246 00:14:02.440 --> 00:14:09.359 Let's make it 10 seconds, compile, save, play again 247 00:14:09.359 --> 00:14:11.079 and move the character to the platform 248 00:14:11.079 --> 00:14:14.339 Looking at the top left corner of the mask 249 00:14:14.339 --> 00:14:19.559 you can see that it says Detected 250 00:14:19.559 --> 00:14:23.459 That means 251 00:14:23.459 --> 00:14:24.760 it's working properly 252 00:14:24.760 --> 00:14:29.719 So now we can add some functions 253 00:14:29.719 --> 00:14:33.000 to ActorBeginOverlap 254 00:14:33.000 --> 00:14:35.840 Let's delete Print String 255 00:14:35.840 --> 00:14:39.679 What are we going to do with this node? 256 00:14:39.679 --> 00:14:44.119 We're going to rotate this door on this level to open it 257 00:14:44.119 --> 00:14:46.400 Let's add a node 258 00:14:46.400 --> 00:14:58.000 Right-click and select Add Actor World Rotation 259 00:14:58.000 --> 00:15:01.440 Let's take this node out 260 00:15:01.440 --> 00:15:06.280 This node rotates the actor 261 00:15:06.280 --> 00:15:11.162 So, if you look, we need 262 00:15:11.162 --> 00:15:12.840 two data pins on the left 263 00:15:12.840 --> 00:15:14.960 One is who the target is 264 00:15:14.960 --> 00:15:18.599 If we say self now, it means BP_Door itself 265 00:15:18.599 --> 00:15:23.200 In other words, what I'm saying is that this thing itself will rotate 266 00:15:23.200 --> 00:15:25.440 This platform itself will rotate 267 00:15:25.440 --> 00:15:27.599 but we don't want that 268 00:15:27.599 --> 00:15:32.159 So what we want is this door 269 00:15:32.159 --> 00:15:33.320 so another actor 270 00:15:33.320 --> 00:15:36.320 So, we will put this other actor in a variable 271 00:15:36.320 --> 00:15:39.200 and connect that actor here 272 00:15:39.200 --> 00:15:41.760 so that it can rotate 273 00:15:41.760 --> 00:15:42.719 the external actor 274 00:15:42.719 --> 00:15:46.320 So, we're going to create a variable first 275 00:15:46.320 --> 00:15:48.799 In VARIABLES, press the + button 276 00:15:48.799 --> 00:15:52.440 and name it Door 277 00:15:52.440 --> 00:15:59.640 Since we need to put the external actor in a variable 278 00:15:59.640 --> 00:16:04.880 the container that holds the actor, the data type, must be the Actor 279 00:16:04.880 --> 00:16:09.479 I'll make a big choice for the classification and search for Actor here 280 00:16:12.960 --> 00:16:18.039 Then, among the object types of Actor 281 00:16:18.039 --> 00:16:22.320 there is an item called Object Reference in Actor 282 00:16:22.320 --> 00:16:24.119 If you click on this item 283 00:16:24.119 --> 00:16:30.880 it will be created as a variable containing the actor class 284 00:16:30.880 --> 00:16:33.919 When we learned about data types 285 00:16:33.919 --> 00:16:38.069 we said there are two types of actor data types 286 00:16:38.069 --> 00:16:39.799 basic and user-defined data types 287 00:16:39.799 --> 00:16:41.799 This actor data type belongs to the second 288 00:16:41.799 --> 00:16:45.359 user-defined data type 289 00:16:45.359 --> 00:16:49.640 In particular, this actor is a user data type created in Unreal 290 00:16:49.640 --> 00:16:52.520 So, you can think of it as a class data type 291 00:16:52.520 --> 00:16:57.440 created in advance to contain a class called Actor 292 00:16:57.440 --> 00:17:03.159 Since we need to put a door in this variable from the outside 293 00:17:03.159 --> 00:17:08.479 let's turn on the eye or check the Instance Editable item 294 00:17:08.479 --> 00:17:12.440 to set it so that it can be pulled out 295 00:17:12.440 --> 00:17:15.960 And this Door variable should now be connected here 296 00:17:15.960 --> 00:17:19.919 We need to drag and drop it and click Get Door 297 00:17:19.919 --> 00:17:21.039 to get the variable 298 00:17:21.039 --> 00:17:23.289 Let's take this variable and connect 299 00:17:23.289 --> 00:17:25.633 this variable to Target like this 300 00:17:30.804 --> 00:17:33.320 Compile and save it, and let's take a look 301 00:17:33.320 --> 00:17:39.039 Then, if you select this blueprint and look at the Details window 302 00:17:39.039 --> 00:17:43.440 you can see a variable called Door in the middle 303 00:17:43.440 --> 00:17:46.840 This Door doesn't contain anything right now 304 00:17:46.840 --> 00:17:51.880 so you just need to assign this Door to this slot 305 00:17:51.880 --> 00:17:55.840 You can do this by clicking the None sign 306 00:17:55.840 --> 00:18:01.320 and selecting SM_Door directly 307 00:18:01.320 --> 00:18:07.080 Or, you can click the clicker button on the right 308 00:18:07.080 --> 00:18:10.286 directly select this object, and bring it in 309 00:18:14.840 --> 00:18:16.119 Like this 310 00:18:16.119 --> 00:18:17.640 Then you can see that it's been entered 311 00:18:17.640 --> 00:18:20.119 So it's been selected like this 312 00:18:20.119 --> 00:18:22.280 If you come back 313 00:18:22.280 --> 00:18:25.330 you can see that this variable 314 00:18:25.330 --> 00:18:27.840 now contains the Door actor 315 00:18:27.840 --> 00:18:31.200 We're going to add a function 316 00:18:31.200 --> 00:18:35.880 for that Door to rotate 317 00:18:35.880 --> 00:18:40.440 If you look, there's an item here 318 00:18:40.440 --> 00:18:43.140 The item below here controls 319 00:18:43.140 --> 00:18:46.119 how much it will rotate 320 00:18:46.119 --> 00:18:48.880 If you look, it says Delta Rotation 321 00:18:48.880 --> 00:18:51.280 then X, Y, and Z 322 00:18:51.280 --> 00:18:58.000 In other words, you can think of Delta as a variable value 323 00:18:58.000 --> 00:19:02.479 Delta Rotation means, "How much will it rotate?" 324 00:19:02.479 --> 00:19:04.840 "How much will it rotate?" 325 00:19:04.840 --> 00:19:07.340 How much will it rotate on the X-axis, Y-axis 326 00:19:07.340 --> 00:19:09.960 and how much will it rotate on the Z-axis 327 00:19:09.960 --> 00:19:14.599 You can think of it as setting how much it will rotate 328 00:19:14.599 --> 00:19:17.479 Here's the concept 329 00:19:17.479 --> 00:19:19.212 If you select the Door actor 330 00:19:19.212 --> 00:19:22.320 and look at Rotation, there are X, Y, and Z 331 00:19:22.320 --> 00:19:28.719 You can think of it as specifying the angles of X, Y, and Z 332 00:19:28.719 --> 00:19:30.880 As you can see, what we want is this 333 00:19:30.880 --> 00:19:33.760 the arrows are X, Y, and Z 334 00:19:33.760 --> 00:19:35.880 The gizmo is based on the world 335 00:19:35.880 --> 00:19:38.329 Since we're going to rotate it based on the world 336 00:19:38.329 --> 00:19:43.357 if you look at it based on the world 337 00:19:43.357 --> 00:19:47.872 you'll see that it moves 338 00:19:47.872 --> 00:19:50.744 based on the blue arrow Z-axis 339 00:19:50.744 --> 00:19:55.944 So, you can add 90 degrees like this 340 00:19:55.944 --> 00:19:58.835 Turn it back 341 00:19:58.835 --> 00:20:04.435 and input 90 degrees only on the Z-axis 342 00:20:04.435 --> 00:20:06.905 Since they're all combined now 343 00:20:06.905 --> 00:20:10.655 I'd like to separate 344 00:20:10.655 --> 00:20:13.405 the combined Input Pin 345 00:20:13.405 --> 00:20:15.880 So, I'll right-click on the Input Pin 346 00:20:15.880 --> 00:20:20.480 Then there's an item called Split Struct Pin 347 00:20:20.480 --> 00:20:22.680 I'll select this 348 00:20:22.680 --> 00:20:27.730 Then, you can see that it's separated into X, Y, and Z 349 00:20:27.730 --> 00:20:31.928 X and Y will stay the same, and we want the Z-axis 350 00:20:31.928 --> 00:20:36.880 We can input 90 degrees on the Z-axis like this 351 00:20:36.880 --> 00:20:39.980 Then, we can connect it to 352 00:20:39.980 --> 00:20:42.218 ActorBeginOverlap like this 353 00:20:45.639 --> 00:20:47.889 Then, when the overlap occurs 354 00:20:47.889 --> 00:20:53.480 it will rotate the Door actor 355 00:20:53.480 --> 00:20:57.380 90 degrees on the Z-axis 356 00:20:57.380 --> 00:20:58.578 Let's give it a try 357 00:20:58.578 --> 00:21:00.578 Click Compile and Save 358 00:21:00.578 --> 00:21:03.799 I came back and try to click Play 359 00:21:03.799 --> 00:21:05.499 Wait 360 00:21:05.499 --> 00:21:10.040 Right now, this door is probably not going to move 361 00:21:10.040 --> 00:21:12.140 If you play, it won't move 362 00:21:12.140 --> 00:21:17.000 The reason for this is because the properties of this mesh are set not to move 363 00:21:17.000 --> 00:21:21.400 In other words, it's set to stationary, not moving 364 00:21:21.400 --> 00:21:24.767 If you look in the Details window 365 00:21:24.767 --> 00:21:28.080 and select this door in the Details window 366 00:21:28.080 --> 00:21:32.320 there's an item called Mobility under Transform 367 00:21:32.320 --> 00:21:34.178 This Mobility item is that 368 00:21:34.178 --> 00:21:36.639 It should be checked as Static 369 00:21:36.639 --> 00:21:38.821 What Static means is that 370 00:21:38.821 --> 00:21:43.478 this actor is set never to move 371 00:21:43.478 --> 00:21:46.778 You need to change this Static to Movable 372 00:21:46.778 --> 00:21:48.400 Then, it will be able to move 373 00:21:48.400 --> 00:21:51.450 If you press the play button in this state 374 00:21:51.450 --> 00:21:54.639 there will be a character, and I'll go to the platform 375 00:21:54.639 --> 00:21:58.639 If you step on the platform like this 376 00:21:58.639 --> 00:22:00.959 you can see that it opens 377 00:22:00.959 --> 00:22:04.709 But as you can see 378 00:22:04.709 --> 00:22:07.599 when I play and press the platform 379 00:22:07.599 --> 00:22:11.440 I don't like how it opens 380 00:22:11.440 --> 00:22:15.290 I wish it would open smoothly 381 00:22:15.290 --> 00:22:18.119 but it doesn't feel natural because it opens like this 382 00:22:18.119 --> 00:22:20.969 So, we will make this node that we created 383 00:22:20.969 --> 00:22:26.357 so that the door can open more smoothly 384 00:22:28.679 --> 00:22:30.579 So how should we do that? 385 00:22:30.579 --> 00:22:33.879 It would be good to rotate it little by little 386 00:22:33.879 --> 00:22:35.800 in every frame 387 00:22:35.800 --> 00:22:43.479 OK, then, let's connect this node to the tick 388 00:22:43.479 --> 00:22:44.729 Maybe 90 degrees 389 00:22:44.729 --> 00:22:47.520 Since it will rotate 90 degrees every frame 390 00:22:47.520 --> 00:22:49.170 let's untie this 391 00:22:49.170 --> 00:22:51.620 Since it will rotate 90 degrees every frame 392 00:22:51.620 --> 00:22:53.240 it seems like it will rotate a lot 393 00:22:53.240 --> 00:22:56.040 Let's make it move slowly 394 00:22:56.040 --> 00:23:00.960 1 degree per frame 395 00:23:00.960 --> 00:23:04.759 Let's see what happens I'll compile and save 396 00:23:04.759 --> 00:23:07.109 If we play it 397 00:23:07.109 --> 00:23:10.299 it looks like 398 00:23:10.299 --> 00:23:13.299 it's working fine 399 00:23:13.299 --> 00:23:15.839 It looks like it's working fine 400 00:23:15.839 --> 00:23:17.589 but there's a problem here 401 00:23:17.589 --> 00:23:20.389 You can see that the door is rotating 402 00:23:20.389 --> 00:23:23.119 even though we haven't stepped on the platform 403 00:23:23.119 --> 00:23:27.169 We want it to move when we step on the platform 404 00:23:27.169 --> 00:23:31.520 It should move when we step on it, but it's moving even though we're not stepping on it 405 00:23:31.520 --> 00:23:35.279 So, we need to add a little more functionality 406 00:23:35.279 --> 00:23:39.529 We need to add a function to set whether or not 407 00:23:39.529 --> 00:23:44.434 this character has stepped on this platform 408 00:23:44.434 --> 00:23:47.838 Let's try this 409 00:23:47.839 --> 00:23:52.686 In the blueprint, how do we tell 410 00:23:52.686 --> 00:23:55.217 if we stepped on the button or the character 411 00:23:55.217 --> 00:23:58.673 stepped on it? 412 00:23:58.673 --> 00:24:01.923 I'm going to create a Boolean variable 413 00:24:01.923 --> 00:24:07.440 I will create a container that can hold and be false 414 00:24:07.440 --> 00:24:11.339 and when ActorBeginOverlap when there's a collision or when they stepped on it 415 00:24:11.339 --> 00:24:16.839 we can change that variable to true 416 00:24:16.839 --> 00:24:19.919 to indicate that it's open 417 00:24:19.919 --> 00:24:24.064 We will make this Rotation node 418 00:24:24.064 --> 00:24:27.364 operate based on the result 419 00:24:27.364 --> 00:24:29.600 of that variable 420 00:24:29.600 --> 00:24:32.050 So, first, we need to create a variable 421 00:24:32.050 --> 00:24:34.900 So I will click the + button on VARIABLES 422 00:24:34.900 --> 00:24:40.000 and name it isOpen 423 00:24:40.000 --> 00:24:43.538 It's going to contain the information, "Is it open?" 424 00:24:43.538 --> 00:24:48.753 So, I'm going to make the data type Boolean 425 00:24:48.753 --> 00:24:51.901 There's no need to make this variable public 426 00:24:51.901 --> 00:24:54.401 We just need to have the information inside 427 00:24:54.401 --> 00:24:56.839 so I don't think it's necessary to open it 428 00:24:56.839 --> 00:24:59.139 I'm going to deactivate 429 00:24:59.139 --> 00:25:02.842 this basic value by compiling and saving 430 00:25:02.842 --> 00:25:07.192 In other words, it's not open 431 00:25:07.192 --> 00:25:10.760 it's notified that it's not open as deactivated 432 00:25:10.760 --> 00:25:13.810 When ActorBeginOverlap is executed 433 00:25:13.810 --> 00:25:17.559 that is, when a collision occurs, and an event occurs 434 00:25:17.559 --> 00:25:24.519 we need to set it to check the isOpen variable like this 435 00:25:24.519 --> 00:25:29.984 How do we do this? When we bring in the isOpen variable 436 00:25:29.984 --> 00:25:33.239 we've only brought in Get isOpen so far 437 00:25:33.239 --> 00:25:39.004 This time, we're going to select Set isOpen like this 438 00:25:39.004 --> 00:25:41.854 So, we will connect the ActorBeginOverlap execution pin 439 00:25:41.854 --> 00:25:47.239 to the Set execution pin 440 00:25:47.239 --> 00:25:53.320 And we're going to check the isOpen of this Set node 441 00:25:53.320 --> 00:25:57.870 Then, when the ActorBeginOverlap event occurs 442 00:25:57.870 --> 00:26:03.318 that is, when the character collides with Collision, execute it 443 00:26:03.318 --> 00:26:09.668 What kind of execution? Set the Set isOpen variable 444 00:26:09.668 --> 00:26:16.040 How? I added a function to set it to check 445 00:26:16.040 --> 00:26:22.850 Let's check if it's working properly 446 00:26:22.850 --> 00:26:25.200 using the Print node 447 00:26:25.200 --> 00:26:27.679 Let's put these guys down 448 00:26:27.679 --> 00:26:31.975 and say 449 00:26:36.399 --> 00:26:42.640 "It's open" here If it works properly 450 00:26:42.640 --> 00:26:46.290 isOpen will be checked 451 00:26:46.290 --> 00:26:50.890 and the phrase "It's open" will be printed 452 00:26:50.890 --> 00:26:51.920 Let's check it out 453 00:26:51.920 --> 00:26:57.000 Let's compile, save, play 454 00:26:57.000 --> 00:26:58.550 and go to the platform 455 00:26:58.550 --> 00:27:05.237 If we go to the platform like this and step on it, "It's open" will appear 456 00:27:05.237 --> 00:27:10.959 Then, we can see that it's working properly 457 00:27:10.959 --> 00:27:14.009 So what we need to do from now on is 458 00:27:14.009 --> 00:27:19.311 Instead of continuing this function 459 00:27:19.311 --> 00:27:23.361 that rotates the Add Actor World Rotation statement 460 00:27:23.361 --> 00:27:28.000 in this event called Tick 461 00:27:28.000 --> 00:27:33.850 we can add a function that says 462 00:27:33.850 --> 00:27:38.974 Do this only when isOpen is true 463 00:27:38.974 --> 00:27:42.119 depending on the situation of this isOpen variable 464 00:27:42.119 --> 00:27:43.710 Now, let's add 465 00:27:43.710 --> 00:27:48.000 a conditional expression 466 00:27:48.000 --> 00:27:50.800 when this Tick event occurs 467 00:27:50.800 --> 00:27:53.720 We learned about the node called Branch earlier 468 00:27:53.720 --> 00:27:54.894 Branch 469 00:28:01.040 --> 00:28:03.140 Using the Branch node 470 00:28:03.140 --> 00:28:05.577 we connect the Branch from this Tick 471 00:28:09.210 --> 00:28:13.360 Depending on the result of this conditional expression of this Branch 472 00:28:13.360 --> 00:28:19.440 if it's true or false, we execute something 473 00:28:19.440 --> 00:28:24.890 Our conditional expression is that when this isOpen 474 00:28:24.890 --> 00:28:30.000 the variable becomes True and open 475 00:28:30.000 --> 00:28:33.400 So, we drag and drop this variable 476 00:28:33.400 --> 00:28:37.250 to Get isOpen 477 00:28:37.250 --> 00:28:42.093 and connect it to this Condition like this 478 00:28:42.093 --> 00:28:46.343 Then, if isOpen is true 479 00:28:46.343 --> 00:28:47.743 the value contained in isOpen 480 00:28:47.743 --> 00:28:51.359 if it's true, True 481 00:28:51.359 --> 00:28:53.509 Iff it's true, the True execution pin 482 00:28:53.509 --> 00:28:59.119 and if it's false, the False execution pin will be activated 483 00:28:59.119 --> 00:29:02.919 When isOpen is true 484 00:29:02.919 --> 00:29:06.679 what do we do when it's open? We said that it'll rotate 485 00:29:06.679 --> 00:29:10.229 So, we can connect the True pin here like this 486 00:29:13.796 --> 00:29:17.484 Easy, right? Since we don't have to do anything when it's False 487 00:29:17.484 --> 00:29:19.479 I don't think we need to connect anything 488 00:29:19.479 --> 00:29:23.029 Let's compile and save in this state and check it out 489 00:29:23.029 --> 00:29:27.039 If you play, the door won't move in its current state 490 00:29:27.039 --> 00:29:35.479 The reason is that the value of Is Open is False now 491 00:29:35.479 --> 00:29:38.329 If you go to the platform 492 00:29:38.329 --> 00:29:42.799 and make the isOpen variable true, it will move 493 00:29:42.799 --> 00:29:44.479 Let's go 494 00:29:44.479 --> 00:29:47.880 It opens 495 00:29:47.880 --> 00:29:49.799 It opens 496 00:29:49.799 --> 00:29:54.699 If you play again and have your character approach the platform 497 00:29:54.699 --> 00:29:59.239 you can see that it moves like this 498 00:29:59.239 --> 00:30:02.139 Okay? There's another problem here 499 00:30:02.139 --> 00:30:05.200 You can see that the door keeps rotating 500 00:30:05.200 --> 00:30:12.876 It should stop when it turns 90 degrees 501 00:30:12.880 --> 00:30:18.380 If the Z value of this Door's Rotation value 502 00:30:18.380 --> 00:30:24.440 is greater than 90 degrees, it should stop 503 00:30:24.440 --> 00:30:28.200 Right? I'll do that here 504 00:30:28.200 --> 00:30:31.900 While it's spinning 505 00:30:31.900 --> 00:30:35.440 here we will create another conditional expression 506 00:30:35.440 --> 00:30:39.397 Branch 507 00:30:39.397 --> 00:30:43.479 Branch, what's the conditional expression? 508 00:30:43.479 --> 00:30:49.559 If the Z value of the Door is greater than 90, right? 509 00:30:49.559 --> 00:30:51.959 That is, this Door 510 00:30:51.959 --> 00:30:54.239 I'll get the Door variable 511 00:30:54.239 --> 00:30:59.200 Get Door, this Door is this Door 512 00:30:59.200 --> 00:31:03.679 We're going to get the Rotation value 513 00:31:03.679 --> 00:31:08.520 That is, we will get the Rotation Z value in the Transform 514 00:31:08.520 --> 00:31:11.620 So we're going to pull it out like this 515 00:31:11.620 --> 00:31:15.599 and among the properties, functions, or values ​​that this Door variable has 516 00:31:15.599 --> 00:31:20.640 we're going to say, Get, get, what? 517 00:31:20.640 --> 00:31:26.239 Actor Rotation 518 00:31:26.239 --> 00:31:32.933 that is, get the rotation value of the actor 519 00:31:32.933 --> 00:31:37.080 Then we've got the rotation value of this Door 520 00:31:37.080 --> 00:31:39.320 That information is now stored here 521 00:31:39.320 --> 00:31:42.679 Likewise, you can subtract the return value 522 00:31:42.679 --> 00:31:47.760 but in this case, the values ​​are all X, Y, and Z 523 00:31:47.760 --> 00:31:49.880 So, we only need to get the Z value here 524 00:31:49.880 --> 00:31:52.030 So right-click here 525 00:31:52.030 --> 00:31:55.200 and click Split Struct Pin 526 00:31:55.200 --> 00:31:57.719 and it will be released right away 527 00:31:57.719 --> 00:32:02.840 We only need to compare this value among these 528 00:32:02.840 --> 00:32:09.760 So if this value, this Z value now is greater than 90 degrees 529 00:32:09.760 --> 00:32:12.919 So right-click 530 00:32:12.919 --> 00:32:13.960 Greater 531 00:32:13.960 --> 00:32:17.239 Bring up the Greater comparison operator 532 00:32:17.239 --> 00:32:20.640 And put this Z value above the comparison operator 533 00:32:20.640 --> 00:32:25.520 elow this, you can decide how much it will be greater than 534 00:32:25.520 --> 00:32:28.080 You can put a general number 535 00:32:28.080 --> 00:32:30.885 but for now, you can just put 536 00:32:30.885 --> 00:32:33.960 the number 90 here 537 00:32:33.960 --> 00:32:40.520 Then, if this Z value is greater 538 00:32:40.520 --> 00:32:43.520 than 90 degrees 539 00:32:43.520 --> 00:32:47.119 it will be established like this 540 00:32:47.119 --> 00:32:49.869 The result value is now connected 541 00:32:49.869 --> 00:32:51.760 to this Branch like this 542 00:32:51.760 --> 00:32:57.719 Then, if this result value is greater than 90 degrees, it should stop 543 00:32:57.719 --> 00:32:59.479 It should stop 544 00:32:59.479 --> 00:33:03.840 If the Z value of Door is greater than 90 degrees 545 00:33:03.840 --> 00:33:05.080 it will proceed with the True value 546 00:33:05.080 --> 00:33:12.479 At that time, we change the isOpen variable back to False 547 00:33:12.479 --> 00:33:15.919 If we changed it 548 00:33:15.919 --> 00:33:21.679 we said this Tick event would occur every frame 549 00:33:21.679 --> 00:33:24.320 When it occurs again 550 00:33:24.320 --> 00:33:30.679 is the isOpen variable inactive? Is it False? 551 00:33:30.679 --> 00:33:34.440 Then, it will say that it should not go to True but to False 552 00:33:34.440 --> 00:33:35.799 and will not do anything 553 00:33:35.799 --> 00:33:37.559 In other words, it will stop 554 00:33:37.559 --> 00:33:40.479 All of this will stop 555 00:33:40.479 --> 00:33:43.200 So, I'm going to do this here 556 00:33:43.200 --> 00:33:46.650 I will bring in the isOpen variable 557 00:33:46.650 --> 00:33:51.039 and open the Set isOpen mode 558 00:33:51.039 --> 00:33:56.119 So, when it's greater than 90 degrees when it's true 559 00:33:56.119 --> 00:34:03.219 I will run it to deactivate the isOpen variable 560 00:34:03.219 --> 00:34:05.719 That's what we did 561 00:34:05.719 --> 00:34:07.919 Done? 562 00:34:07.919 --> 00:34:09.359 Then, let's take a look again 563 00:34:09.359 --> 00:34:11.719 Let's test it here 564 00:34:11.719 --> 00:34:15.869 Let's print "It is now stopped" 565 00:34:15.869 --> 00:34:22.479 through Print String 566 00:34:22.479 --> 00:34:25.320 If this works well 567 00:34:25.320 --> 00:34:27.270 isOpwen will be deactivated 568 00:34:27.270 --> 00:34:32.000 and "It is stopped" will be printed 569 00:34:32.000 --> 00:34:33.559 Then, it must have worked well 570 00:34:33.559 --> 00:34:35.119 We'll know 571 00:34:35.119 --> 00:34:37.058 Let's say "It is stopped" 572 00:34:41.454 --> 00:34:45.559 about 10 times for a long time 573 00:34:45.559 --> 00:34:48.309 Right now, "Open" and "It is opened" 574 00:34:48.309 --> 00:34:50.239 are set to 2 seconds 575 00:34:50.239 --> 00:34:55.320 so that it will disappear quickly, so let's set it to 10 seconds 576 00:34:55.320 --> 00:34:59.479 If you compile, save, and play again 577 00:34:59.479 --> 00:35:03.059 pressing a button like this 578 00:35:03.059 --> 00:35:07.119 will stop with the message "It is opened" 579 00:35:07.119 --> 00:35:08.640 This time, it's finished 580 00:35:08.640 --> 00:35:10.840 After it's fully opened and over 90 degrees 581 00:35:10.840 --> 00:35:13.200 you can see that "It is stopped" is printed 582 00:35:13.200 --> 00:35:17.559 and the door naturally stops 583 00:35:17.559 --> 00:35:24.799 Then, this time, I think the opening speed is a little slow 584 00:35:24.799 --> 00:35:28.559 so I'll look for something suitable 585 00:35:28.559 --> 00:35:31.080 Right now, it's 1 586 00:35:31.080 --> 00:35:34.760 so let's create a variable 587 00:35:34.760 --> 00:35:36.599 to modify it externally 588 00:35:36.599 --> 00:35:39.199 So, I'll click on VARIABLES 589 00:35:39.199 --> 00:35:41.852 and create a variable 590 00:35:41.852 --> 00:35:48.080 I'll name it Speed 591 00:35:48.080 --> 00:35:55.520 I'll make sure the value is Float and up to the decimal point 592 00:35:55.520 --> 00:36:03.960 Then, I'll extract this variable with Get Speed ​​ 593 00:36:03.960 --> 00:36:06.960 ​​and put the variable 594 00:36:06.960 --> 00:36:09.280 into Delta Rotation like this 595 00:36:09.280 --> 00:36:11.440 Click on Compile and Save 596 00:36:11.440 --> 00:36:16.960 For now, we should set the default value for Speed ​​to 1 597 00:36:16.960 --> 00:36:21.440 And I'll check Instance Editable 598 00:36:21.440 --> 00:36:25.440 so that it can be modified externally 599 00:36:25.440 --> 00:36:31.000 Click on Compile and Save This time, when you go outside 600 00:36:31.000 --> 00:36:33.199 it's not this Door 601 00:36:33.199 --> 00:36:35.599 and if you click on this Blueprint 602 00:36:35.599 --> 00:36:39.565 the Blueprint we created, you can see that there are items 603 00:36:39.565 --> 00:36:42.039 that can be set up to the Door Speed 604 00:36:42.039 --> 00:36:45.479 It's currently at 1, but I'll make it faster 605 00:36:45.479 --> 00:36:47.080 How about 10? 606 00:36:47.080 --> 00:36:49.431 I'll play it when it's like this 607 00:36:49.431 --> 00:36:51.479 If I go like this 608 00:36:51.479 --> 00:36:53.719 it's too fast, right? 609 00:36:53.719 --> 00:36:56.440 Let's just make it around 3 610 00:36:56.440 --> 00:36:59.240 You'll see it open 611 00:36:59.240 --> 00:37:01.799 if you play it 612 00:37:01.799 --> 00:37:06.000 If you think it's too fast, you can decrease it further 613 00:37:06.000 --> 00:37:12.479 You can even decrease it to 0.5 614 00:37:12.479 --> 00:37:17.119 You'll see it open slowly like this 615 00:37:17.119 --> 00:37:19.334 I adjusted the speed of the door 616 00:37:19.334 --> 00:37:21.560 using the Speed ​​variable 617 00:37:21.560 --> 00:37:26.680 So, I created a function so that a constant value 618 00:37:26.680 --> 00:37:29.464 increases every frame 619 00:37:29.807 --> 00:37:33.649 Delta Second 620 00:37:34.239 --> 00:37:37.920 But this function has a fatal error 621 00:37:37.920 --> 00:37:41.040 It is not an error at this point 622 00:37:41.040 --> 00:37:44.560 on the PC you are playing on 623 00:37:44.560 --> 00:37:48.800 However, learning about the delta second concept 624 00:37:48.800 --> 00:37:55.439 will help you realize this mod has a huge error 625 00:37:55.439 --> 00:37:58.680 Let's learn about delta second 626 00:37:58.680 --> 00:38:00.760 First, let's say there are two PCs 627 00:38:00.760 --> 00:38:04.119 Let's say that two players, Cheol-soo and Young-hee 628 00:38:04.119 --> 00:38:07.959 are playing a racing game with two computers 629 00:38:07.959 --> 00:38:11.760 This race game is designed so that 630 00:38:11.760 --> 00:38:14.560 each frame reads 1 meter 631 00:38:14.560 --> 00:38:17.640 Let's say Cheol-soo's computer is a bit better 632 00:38:17.640 --> 00:38:21.199 so it takes 0.25 seconds to read one frame 633 00:38:21.199 --> 00:38:23.800 And in the case of Young-hee's computer 634 00:38:23.800 --> 00:38:29.160 if it takes 0.5 seconds 635 00:38:29.160 --> 00:38:33.400 when 1 second passes, Cheol-soo's PC will have read 4 times 636 00:38:33.400 --> 00:38:37.680 and every time it reads a frame, it will move 1 meter each 637 00:38:37.680 --> 00:38:41.479 so that Cheol-soo will have moved 4 meters 638 00:38:41.479 --> 00:38:47.239 Young-hee's PC will read two frames per second 639 00:38:47.239 --> 00:38:49.040 Since it reads 0.5 seconds per frame 640 00:38:49.040 --> 00:38:52.540 it will read 1m per frame 641 00:38:52.540 --> 00:38:54.400 and 1m per frame 642 00:38:54.400 --> 00:38:56.550 so as a result, it will move 2m 643 00:38:56.550 --> 00:38:59.199 in 1 second 644 00:38:59.199 --> 00:39:04.719 In other words, Yeong-hee will always lag behind Cheol-soo 645 00:39:04.719 --> 00:39:08.880 This means that the result of the running game will differ 646 00:39:08.880 --> 00:39:13.199 depending on whether the PC is good or bad 647 00:39:13.199 --> 00:39:16.839 This will cause unfairness 648 00:39:16.839 --> 00:39:19.800 So the method used is 649 00:39:19.800 --> 00:39:21.756 right here, delta seconds 650 00:39:21.756 --> 00:39:26.280 That is, the displacement time is applied 651 00:39:26.280 --> 00:39:30.430 It multiplies the time to read one frame 652 00:39:30.430 --> 00:39:32.800 and maintains it at a certain time 653 00:39:32.800 --> 00:39:37.200 In other words, it forces the movement to be 1m 654 00:39:37.200 --> 00:39:39.040 when 1 second has passed 655 00:39:39.040 --> 00:39:43.000 So for each frame 656 00:39:43.000 --> 00:39:50.000 Cheol-soo multiplies a fixed amount of time by a slightly smaller number, 0.25 657 00:39:50.000 --> 00:39:53.600 and Young-hee's computer multiplies it by 0.5 658 00:39:53.600 --> 00:39:55.400 which is a slightly different 659 00:39:55.400 --> 00:39:58.900 Cheol-soo and Young-hee's computers multiply 660 00:39:58.900 --> 00:40:01.182 slightly different amounts of time 661 00:40:01.182 --> 00:40:05.032 In the end, these two players 662 00:40:05.032 --> 00:40:08.682 can get the same result 663 00:40:08.682 --> 00:40:12.359 of moving 1m in 1 second 664 00:40:12.359 --> 00:40:16.759 Then, it won't be unfair to either of them 665 00:40:16.759 --> 00:40:20.809 Multiplying this Speed ​​value by the value of the time 666 00:40:20.809 --> 00:40:25.719 to read this frame, called delta seconds 667 00:40:25.719 --> 00:40:29.019 fixes the overall time 668 00:40:29.019 --> 00:40:31.519 This is the most basic element in programming 669 00:40:31.519 --> 00:40:33.669 the most basic element 670 00:40:33.669 --> 00:40:37.920 in creating real-time content 671 00:40:37.920 --> 00:40:39.570 So I'm going to do that 672 00:40:39.570 --> 00:40:43.070 So if you right-click in this blank space 673 00:40:43.070 --> 00:40:52.501 and search for displacement time, Get World delta Seconds 674 00:40:52.501 --> 00:40:53.848 this node will appear 675 00:40:56.343 --> 00:40:58.793 This Delta Second is different for each PC 676 00:40:58.793 --> 00:41:00.683 It varies depending on the situation 677 00:41:00.683 --> 00:41:05.083 Since this is information that the engine calculates and sends 678 00:41:05.083 --> 00:41:08.260 you can just take it and use it 679 00:41:08.260 --> 00:41:10.460 So you need to multiply this Delta Seconds 680 00:41:10.460 --> 00:41:13.670 by this Speed ​​value 681 00:41:13.670 --> 00:41:15.825 So, Multiply 682 00:41:18.735 --> 00:41:22.750 Multiply this Speed ​​value by this Delta Seconds 683 00:41:22.750 --> 00:41:26.700 and connect this multiplied result 684 00:41:26.700 --> 00:41:30.959 to Delta Rotation like this 685 00:41:30.959 --> 00:41:35.759 This way, the fairness between devices will not be violated 686 00:41:35.759 --> 00:41:37.245 Let's play 687 00:41:40.040 --> 00:41:42.048 Now, if you press the pedal 688 00:41:46.364 --> 00:41:50.329 it will probably not seem to be moving 689 00:41:52.840 --> 00:41:56.840 but if you press F8 and come out 690 00:41:56.840 --> 00:41:59.590 very slightly 691 00:41:59.590 --> 00:42:03.800 You can see it keep going up 692 00:42:03.800 --> 00:42:06.150 That means it is moving 693 00:42:06.150 --> 00:42:09.950 The reason it's so small is because by multiplying by the delta second 694 00:42:09.950 --> 00:42:12.100 the number moving per frame 695 00:42:12.100 --> 00:42:14.245 has become very low 696 00:42:14.245 --> 00:42:18.295 So now, we need to increase 697 00:42:18.295 --> 00:42:20.800 this Speed ​​value a lot 698 00:42:20.800 --> 00:42:22.550 It had become very low at 0.5 699 00:42:22.550 --> 00:42:25.850 This time, I'll increase it a bit to around 10 700 00:42:25.850 --> 00:42:28.826 If you play it 701 00:42:28.826 --> 00:42:31.426 It's a bit faster than before 702 00:42:31.426 --> 00:42:32.520 We need to go a bit faster 703 00:42:35.490 --> 00:42:38.021 Let's put it at around 100 704 00:42:38.021 --> 00:42:41.160 If you play it 705 00:42:41.160 --> 00:42:46.577 the result is the same in that it opens when you step on the pedal 706 00:42:46.577 --> 00:42:49.985 but to ensure fairness between devices 707 00:42:49.985 --> 00:42:52.885 we applied something called delta second 708 00:42:52.885 --> 00:42:55.635 which is different from the current system 709 00:42:55.635 --> 00:42:59.085 So now, when you run this function on this PC or another 710 00:42:59.085 --> 00:43:04.066 it will move the same way 711 00:43:04.066 --> 00:43:07.877 So, I created a simple function 712 00:43:07.877 --> 00:43:10.377 to open a door using blueprints 713 00:43:10.377 --> 00:43:12.520 Thank you 714 00:43:12.520 --> 00:43:15.684 Now, let's summarize what we learned 715 00:43:16.648 --> 00:43:17.898 Role of Collision and How It Works Automatic Door Implement automatic door function that opens by rotating when you step on the step Drag SM_Door asset from StarterContent - Props and place it in the world 716 00:43:17.898 --> 00:43:19.148 Create a BP folder - Create a BP_Door blueprint inheriting the Actor class and place it in the level 717 00:43:19.148 --> 00:43:20.398 Blueprint Scripting Add a Cube component using the +Add component in the component window Add a Box Collision component for collision with the character 718 00:43:20.398 --> 00:43:21.598 Testing collision detection using Print String node in [Event ActorBeginOverlap] 719 00:43:21.598 --> 00:43:22.298 Set up the door rotation Use the Add Actor World Rotation node to operate Create a Door variable that contains the object to rotate and connect it to the Target input pin 720 00:43:22.298 --> 00:43:22.998 Connect the Event Tick node to the Add Actor World Rotation node, then set the Delta Rotation Z value Create the isOpen variable, then select the Boolean data type 721 00:43:22.998 --> 00:43:23.648 Connect the Event Tick node to the Add Actor World Rotation node, then set the Delta Rotation Z value Create the isOpen variable, then select the Bool 722 00:43:23.648 --> 00:43:24.348 Set the isOpen variable to be activated when ActorBeginOverlap is executed Set the door to rotate only when the isOpen variable is True 723 00:43:24.348 --> 00:43:25.070 Set the door to stop rotating when the Rotation Z value of SM_Door is greater than 90 724 00:43:25.070 --> 00:43:25.815 Control door rotation speed Create a variable, name it Speed, and select Float data type 725 00:43:25.815 --> 00:43:26.568 Drag the Speed ​​variable to the graph window, select Get Speed, and connect it to the Delta Rotation Z pin Enable Instance Editable to enable external modification 726 00:43:26.568 --> 00:43:27.568 Delta Second Understanding Frames If the code moves a certain distance per frame, the distance will vary depending on the performance of the device 727 00:43:27.568 --> 00:43:28.568 The game path will vary depending on the device specifications, which is unfair 728 00:43:28.568 --> 00:43:29.568 Delta Second To ensure fairness between devices, apply the displacement time Delta Second, the time it takes to read 1 frame If you apply Delta Second, you can adjust it to move the same distance simultaneously 729 00:43:29.568 --> 00:43:30.518 Apply Delta Seconds Create Get World delta Seconds node Create Multiply and connect Speed ​​and Get World Delta Seconds nodes 730 00:43:30.518 --> 00:43:31.485 Connect Multiply result to Delta Rotation Z pin Check that the door rotation speed changes depending on the Speed ​​value