WEBVTT 1 00:00:05.675 --> 00:00:09.834 Game advanced level Process moving of player 2 00:00:23.588 --> 00:00:25.568 Hello, my name is Lee Yeong Ho 3 00:00:25.568 --> 00:00:29.080 We will learn about processing movement of player in this chapter 4 00:00:29.080 --> 00:00:32.430 As learning contents, add external assets 5 00:00:32.430 --> 00:00:35.820 and use it to create movement animation assets 6 00:00:35.820 --> 00:00:39.470 Next, in order to control this animation 7 00:00:39.470 --> 00:00:41.959 We create C class 8 00:00:41.959 --> 00:00:44.859 And last, we will learn how to edit 9 00:00:44.859 --> 00:00:47.809 and use animation blueprint which inherits 10 00:00:47.809 --> 00:00:49.420 C class we create 11 00:00:49.420 --> 00:00:53.281 Add External Assets and Create Movement Animation Assets 12 00:00:54.020 --> 00:00:57.040 Then let's add external assets we will use 13 00:00:57.040 --> 00:00:59.890 for adding external assets we will use 14 00:00:59.890 --> 00:01:03.400 you should have materials we have distributed 15 00:01:03.400 --> 00:01:06.250 Assets we need already are 16 00:01:06.250 --> 00:01:07.450 distributed like this 17 00:01:07.450 --> 00:01:10.199 So download from here and process 18 00:01:10.199 --> 00:01:15.080 First asset we will use among these is Animations folder 19 00:01:15.080 --> 00:01:20.199 So grab it and unzip it 20 00:01:20.199 --> 00:01:22.349 Then you have Animations folder here 21 00:01:22.349 --> 00:01:25.519 and you would have these FBX files 22 00:01:25.519 --> 00:01:29.169 We will bring this to our project to use 23 00:01:29.169 --> 00:01:32.269 So put this Animations folder into NetTPS 24 00:01:32.269 --> 00:01:35.279 Drag and drop it into 25 00:01:35.279 --> 00:01:39.279 NetTPS folder in unreal engine 26 00:01:39.279 --> 00:01:41.479 Drag and drop Animations folder 27 00:01:41.479 --> 00:01:43.620 to bring it here 28 00:01:46.080 --> 00:01:49.830 Then FBX Import Options window will open like this 29 00:01:49.830 --> 00:01:53.320 What we are going to use in here is 30 00:01:53.320 --> 00:01:55.300 Click dropdown menu on Skeleton 31 00:01:55.300 --> 00:01:57.530 You see this SK_Mannequin 32 00:01:57.530 --> 00:01:58.830 There is SK_Mannequin 33 00:01:58.830 --> 00:02:01.800 This one below is what we used on unreal engine 4 34 00:02:01.800 --> 00:02:04.700 This one is mannequin character 35 00:02:04.700 --> 00:02:08.639 Added to unreal engine 5, we will use this 36 00:02:08.639 --> 00:02:10.539 Select this 37 00:02:10.539 --> 00:02:12.839 and click Import All button 38 00:02:12.839 --> 00:02:15.520 to bring it here 39 00:02:17.919 --> 00:02:19.919 Then all of it has been brought 40 00:02:19.919 --> 00:02:23.919 Click Save All button 41 00:02:23.919 --> 00:02:26.680 To save them all 42 00:02:26.680 --> 00:02:29.780 Let's take a look at character animations we brought 43 00:02:29.780 --> 00:02:32.000 There are these kind of animations 44 00:02:32.000 --> 00:02:35.450 and we will use them 45 00:02:35.450 --> 00:02:38.440 under the necessity 46 00:02:38.440 --> 00:02:43.440 And dying animation We brought these kind of animations 47 00:02:43.440 --> 00:02:47.440 Next, we will change skeletal mesh 48 00:02:47.440 --> 00:02:50.759 and Anim class we will use 49 00:02:50.759 --> 00:02:54.059 Inside of Blueprints folder 50 00:02:54.059 --> 00:02:56.309 We have BP_ThirdPerson 51 00:02:56.309 --> 00:02:59.479 I already opend it but if you open it 52 00:02:59.479 --> 00:03:02.240 It is opened already 53 00:03:02.240 --> 00:03:04.420 We have character like this 54 00:03:04.420 --> 00:03:07.720 Let's change this to skeleton we want 55 00:03:07.720 --> 00:03:10.040 and some skeletal mesh 56 00:03:10.040 --> 00:03:12.290 and animation instance files 57 00:03:12.290 --> 00:03:15.600 to Anim instance files 58 00:03:15.600 --> 00:03:21.800 There is Mesh on the left side 59 00:03:21.800 --> 00:03:24.550 If you select Mesh component 60 00:03:24.550 --> 00:03:28.600 There is Mesh we will use on Details window on the right 61 00:03:28.600 --> 00:03:31.080 There is Skeletal Mesh Assets 62 00:03:31.080 --> 00:03:33.660 It says SKM_Quinn 63 00:03:33.660 --> 00:03:35.679 But I'm going to open it 64 00:03:35.679 --> 00:03:40.520 and change it to SKM_Manny 65 00:03:40.520 --> 00:03:44.000 Then it changes to muscular male character 66 00:03:44.000 --> 00:03:45.310 It doesn't matter either Quinn 67 00:03:45.310 --> 00:03:46.479 or Manny 68 00:03:46.479 --> 00:03:49.129 Most important thing we use is 69 00:03:49.129 --> 00:03:50.929 Go to Animation part 70 00:03:50.929 --> 00:03:52.909 Animation Mode of Animation is 71 00:03:52.909 --> 00:03:55.199 set to Use Animation Blueprint 72 00:03:55.199 --> 00:03:59.549 and Anim Class below is set to ABP_Quinn 73 00:03:59.549 --> 00:04:01.649 I'm not going to use this 74 00:04:01.649 --> 00:04:04.119 but this ABP_Manny 75 00:04:04.119 --> 00:04:06.319 This is why I changed it 76 00:04:06.319 --> 00:04:11.459 I changed Anim Class to ABP_Manny 77 00:04:11.459 --> 00:04:12.659 Now compile it 78 00:04:12.659 --> 00:04:15.409 Let's move to where this ABP_Manny is 79 00:04:15.409 --> 00:04:17.059 To move there from here 80 00:04:17.059 --> 00:04:19.439 Next to Anim Class 81 00:04:19.439 --> 00:04:23.839 There is browser icon If you click it 82 00:04:23.839 --> 00:04:26.339 Then jump into the directory for that asset 83 00:04:26.339 --> 00:04:30.280 If you see Mannequins folder on your Content Browser 84 00:04:30.280 --> 00:04:32.220 It is located under the Characters 85 00:04:32.220 --> 00:04:34.120 Under the Mannequins under the Animation folder 86 00:04:34.120 --> 00:04:37.400 Right? I'm trying to use this 87 00:04:37.400 --> 00:04:41.190 To make it easier for us to work 88 00:04:41.190 --> 00:04:45.500 Move ABP_Manny to Animations folder 89 00:04:45.500 --> 00:04:47.279 Under the NetTPS we usually use 90 00:04:47.279 --> 00:04:49.829 Grab this and drag and drop 91 00:04:49.829 --> 00:04:51.929 To this Animations folder 92 00:04:51.929 --> 00:04:54.629 To Animations folder under the NetTPS 93 00:04:54.629 --> 00:04:57.320 Drag and drop 94 00:04:57.320 --> 00:04:59.770 Then select Move Here 95 00:04:59.770 --> 00:05:04.320 Then under the NetTPS, under the Animation folder 96 00:05:04.320 --> 00:05:06.799 We have ABP_Manny here 97 00:05:06.799 --> 00:05:10.499 Alright, then we added external assets 98 00:05:10.499 --> 00:05:13.679 We will use like this 99 00:05:13.679 --> 00:05:17.359 Now let's create movement animation assets 100 00:05:17.359 --> 00:05:19.319 Animations we have now is 101 00:05:19.319 --> 00:05:21.919 Basically when you play 102 00:05:21.919 --> 00:05:23.799 It doesn't have guns and just running 103 00:05:23.799 --> 00:05:26.849 But the animation assets we just have added are 104 00:05:26.849 --> 00:05:29.799 for the work with guns 105 00:05:29.799 --> 00:05:32.449 Therefore we have to create 106 00:05:32.449 --> 00:05:35.899 New movement animation assets so that we can use 107 00:05:35.899 --> 00:05:40.000 Newly added animations instead of existed ones 108 00:05:40.000 --> 00:05:41.700 Let's create them 109 00:05:41.700 --> 00:05:44.200 with Blend Space 110 00:05:44.200 --> 00:05:49.320 Click right button on here 111 00:05:49.320 --> 00:05:50.459 Then popup menu appears 112 00:05:50.459 --> 00:05:52.639 on this content window 113 00:05:52.639 --> 00:05:58.280 On this menu, keep goes down on Animations category 114 00:05:58.280 --> 00:06:00.480 There is Blend Space around the middle of it 115 00:06:00.480 --> 00:06:02.280 Now click this 116 00:06:02.280 --> 00:06:06.359 Then the Skeletal Mesh this Blend Space will use is 117 00:06:06.359 --> 00:06:09.309 This one 118 00:06:09.309 --> 00:06:10.839 Let me show you again 119 00:06:10.839 --> 00:06:14.659 Right click and on the Animation category 120 00:06:14.659 --> 00:06:17.839 Select Blend Space 121 00:06:17.839 --> 00:06:23.559 And choose SK_Mannequin as Skeletal to use 122 00:06:23.559 --> 00:06:25.359 Choose this 123 00:06:25.359 --> 00:06:28.749 And name is BS, this stands for Blend Space 124 00:06:28.749 --> 00:06:35.799 _PistolMove 125 00:06:35.799 --> 00:06:39.349 So BS_PistolMove 126 00:06:39.349 --> 00:06:43.349 Blend Space perform a role 127 00:06:43.349 --> 00:06:45.819 to blend animation and animation appropriately 128 00:06:45.819 --> 00:06:47.880 with the value of float, right? 129 00:06:47.880 --> 00:06:50.510 So if you open this 130 00:06:50.510 --> 00:06:53.560 Since there is any animation clip in this 131 00:06:53.560 --> 00:06:57.000 So it has basic posture, which is called pose A 132 00:06:57.000 --> 00:07:00.750 The skeletals like this, bones are tied altogether like this 133 00:07:00.750 --> 00:07:05.079 and these league, connection points are 134 00:07:05.079 --> 00:07:09.079 Tied as the shape of A are called pose A 135 00:07:09.079 --> 00:07:12.920 Pose A is used a lot on unreal engine 136 00:07:12.920 --> 00:07:15.470 or shape of T like this 137 00:07:15.470 --> 00:07:17.820 In here, pose A skeletal 138 00:07:17.820 --> 00:07:20.920 of unreal engine 5 is used 139 00:07:20.920 --> 00:07:22.770 This is the basic posture 140 00:07:22.770 --> 00:07:25.470 Animations we use 141 00:07:25.470 --> 00:07:28.440 will be stored on the stage here 142 00:07:28.440 --> 00:07:30.590 Add it one by one 143 00:07:30.590 --> 00:07:33.140 and adjust input value to use 144 00:07:33.140 --> 00:07:36.979 Then the sequence of animation that is added 145 00:07:36.979 --> 00:07:39.729 How the animation will be played? 146 00:07:39.729 --> 00:07:43.589 It says None on the left 147 00:07:43.589 --> 00:07:46.040 None with vertical arrows 148 00:07:46.040 --> 00:07:48.840 And on the bottom, between horizontal arrows 149 00:07:48.840 --> 00:07:50.460 It says None 150 00:07:50.460 --> 00:07:53.460 Use the value inputted here 151 00:07:53.460 --> 00:07:55.920 to add animations 152 00:07:55.920 --> 00:07:58.820 on these positions 153 00:07:58.820 --> 00:08:01.620 And the position of animation changes depend on this value when it is added 154 00:08:01.620 --> 00:08:03.820 So the value of animations is blended 155 00:08:03.820 --> 00:08:05.870 appropriately depends on this 156 00:08:05.870 --> 00:08:08.270 So we are going to set this values 157 00:08:08.270 --> 00:08:10.799 There is Asset Details window on the left 158 00:08:10.799 --> 00:08:15.539 There are Horizontal Axis and Vertical Axis in here 159 00:08:15.539 --> 00:08:18.399 Horizontal Axis is related to 160 00:08:18.399 --> 00:08:21.549 left and right on the bottom 161 00:08:21.549 --> 00:08:23.989 And Vertical Axis means 162 00:08:23.989 --> 00:08:27.160 This part about up and down 163 00:08:27.160 --> 00:08:29.860 So we will set Name of Horizontal Axis 164 00:08:29.860 --> 00:08:34.680 to distinguish the directions of up, down, left and right 165 00:08:34.680 --> 00:08:38.600 Set the name of variable as Direction 166 00:08:38.600 --> 00:08:43.440 Then it changes to Direction like this 167 00:08:43.440 --> 00:08:45.990 and for the Vertical Axis 168 00:08:45.990 --> 00:08:50.090 set this to Speed 169 00:08:50.090 --> 00:08:54.679 Then it means speed, the velocity of running forward and backward 170 00:08:54.679 --> 00:08:57.879 And forward animation, running animation 171 00:08:57.879 --> 00:09:00.429 walking animation, I'm going to process to play these animations 172 00:09:00.429 --> 00:09:01.400 appropriately 173 00:09:01.400 --> 00:09:05.130 First, then what kind of values 174 00:09:05.130 --> 00:09:07.480 This Direction and Speed would have 175 00:09:07.480 --> 00:09:10.799 The range of these values is from 0 to 100 for now 176 00:09:10.799 --> 00:09:14.349 As you can see, it is set from 0 to 100 177 00:09:14.349 --> 00:09:16.649 But for the case of our character 178 00:09:16.649 --> 00:09:19.240 It's in the BP_ThirdPersonCharacter 179 00:09:19.240 --> 00:09:23.960 If you take a look at Walk Speed of Character Movement 180 00:09:25.200 --> 00:09:28.750 Max Walk Speed is set to 500 181 00:09:28.750 --> 00:09:32.200 which means this one is able to run up to 500 182 00:09:32.200 --> 00:09:36.059 So we have to apply with this value 183 00:09:36.059 --> 00:09:37.659 Here is set to 100 now 184 00:09:37.659 --> 00:09:41.609 So in the BP_ThirdPersonCharacter 185 00:09:41.609 --> 00:09:43.660 In the Character Movement Component 186 00:09:43.660 --> 00:09:47.679 The value of Walk Speed, now I'm going to make it to be adjusted by this value 187 00:09:47.679 --> 00:09:50.629 My Max Walk Speed is set to 500 188 00:09:50.629 --> 00:09:57.159 Change it to 600, maximum 600cm per second 189 00:09:57.159 --> 00:09:59.959 Move in cm units in unreal engine 190 00:09:59.959 --> 00:10:03.960 I made it available to move like this 191 00:10:03.960 --> 00:10:07.960 Set Max Walk Speed to 600 in BP_ThirdPersonCharacter 192 00:10:07.960 --> 00:10:12.039 So next, come back to BS_PistolMove 193 00:10:12.080 --> 00:10:14.680 Now then this is not from 0 to 100 194 00:10:14.680 --> 00:10:17.230 This can run up to 600 195 00:10:17.230 --> 00:10:19.930 on Maximum Axis Value 196 00:10:19.930 --> 00:10:22.560 Then maximum of this is 600 now 197 00:10:22.560 --> 00:10:25.910 On the Direction part 198 00:10:25.910 --> 00:10:30.539 on the bottom, it is 600 now 199 00:10:30.539 --> 00:10:33.039 It changed to 600 200 00:10:33.039 --> 00:10:34.989 So when it run towards left and right 201 00:10:34.989 --> 00:10:37.679 Towards right is 600 now 202 00:10:37.679 --> 00:10:41.769 So towards left is -600 203 00:10:41.769 --> 00:10:44.029 So that it can be from -600 to 600 204 00:10:44.029 --> 00:10:46.599 Make velocity toward both left and right consistent 205 00:10:46.599 --> 00:10:49.149 Now same for the Speed 206 00:10:49.149 --> 00:10:52.079 Set the value 207 00:10:52.079 --> 00:10:54.659 of Minimum and Maximum 208 00:10:54.659 --> 00:10:56.440 to -600 and 600 209 00:10:56.440 --> 00:10:58.440 Now over here 210 00:10:58.440 --> 00:11:01.540 the Grid Divisions is set to 4 211 00:11:01.540 --> 00:11:07.099 So the stage is divided into 4 like this 212 00:11:07.099 --> 00:11:08.749 Right? In a horizontal position 213 00:11:08.749 --> 00:11:12.320 I'm going to divide into smaller pieces 214 00:11:12.320 --> 00:11:16.280 I'm setting this to 6 215 00:11:16.280 --> 00:11:20.530 Same for the Vertical Axis below 216 00:11:20.530 --> 00:11:22.530 set Grid Divisions to 6 217 00:11:22.530 --> 00:11:26.479 Then you can see the stage is now divided into 6 218 00:11:26.479 --> 00:11:29.329 So the basic settings for values are done now 219 00:11:29.329 --> 00:11:33.599 Let's add animation sequence 220 00:11:33.599 --> 00:11:35.949 Do you see Asset Browser on the right 221 00:11:35.949 --> 00:11:40.449 If there isn't, click Asset Browser on Window menu 222 00:11:40.449 --> 00:11:42.159 Then you will have it 223 00:11:42.159 --> 00:11:44.109 On the Asset Browser on the right bottom 224 00:11:44.109 --> 00:11:46.309 We have search filter 225 00:11:46.309 --> 00:11:48.799 says Search Assets 226 00:11:48.799 --> 00:11:53.299 I'm planning to use mf_pistol 227 00:11:53.299 --> 00:11:58.740 use only these animation sequences 228 00:11:58.740 --> 00:12:02.499 You can see several animation sequences here 229 00:12:02.499 --> 00:12:07.000 There is green x mark on the middle 230 00:12:07.000 --> 00:12:08.900 Here at 0,0 231 00:12:08.900 --> 00:12:12.050 Let's add animation for standing still first 232 00:12:12.050 --> 00:12:16.919 There is MF_Pistol_Idle_Hipfire on the top 233 00:12:16.919 --> 00:12:20.919 Add this animation sequence and put it here 234 00:12:20.919 --> 00:12:24.000 Grab it and drag and drop to put it like this 235 00:12:24.000 --> 00:12:26.400 It doesn't go to the center point 236 00:12:26.400 --> 00:12:28.450 It's hard to grab and drag it 237 00:12:28.450 --> 00:12:33.760 But grab and drag it while pressing Shift 238 00:12:33.760 --> 00:12:35.110 It sticks to them 239 00:12:35.110 --> 00:12:39.600 It moves on the gird intersection 240 00:12:39.600 --> 00:12:42.880 Keep pressing Shift when you put it in then it goes on the intersection 241 00:12:42.880 --> 00:12:46.230 So you can see now Idle animation is 242 00:12:46.230 --> 00:12:52.080 playing on this preview viewport window 243 00:12:52.080 --> 00:12:54.080 At the center point 244 00:12:54.080 --> 00:12:57.400 I put Idle_Hipfire animation sequence in 245 00:12:57.400 --> 00:13:02.440 by drag and drop with pressing Shift 246 00:13:02.440 --> 00:13:05.990 Next, when this character moves toward left 247 00:13:05.990 --> 00:13:07.880 Now it's from -600 to 600 248 00:13:07.880 --> 00:13:12.000 I'm going to add animation sequence moving left first 249 00:13:12.000 --> 00:13:14.800 Jog is running and Walk is walking 250 00:13:14.800 --> 00:13:17.540 Grab Walk_Left and put it 251 00:13:17.540 --> 00:13:22.060 Here with pressing Shift 252 00:13:22.060 --> 00:13:26.739 Then put Walk_Right in 253 00:13:26.739 --> 00:13:31.689 Then Walk_Fwd here above 254 00:13:31.689 --> 00:13:37.320 Then Walk_Bwd here 255 00:13:37.320 --> 00:13:41.420 Then it forms a diamond shape 256 00:13:41.420 --> 00:13:45.550 Let's put Jog in this time 257 00:13:45.550 --> 00:13:48.719 All the backward, forward, left and right for Jog are here 258 00:13:48.719 --> 00:13:50.569 Add left first 259 00:13:50.569 --> 00:13:53.219 Keep press Shift 260 00:13:53.219 --> 00:13:55.960 and drag it here then it sticks to the intersection on the edge 261 00:13:55.960 --> 00:14:00.110 Then Right with pressing Shift 262 00:14:00.110 --> 00:14:03.559 Then Jog_Fwd on top 263 00:14:03.559 --> 00:14:06.309 Then Jog_Bwd on bottom 264 00:14:06.309 --> 00:14:08.359 Put them in like this 265 00:14:08.359 --> 00:14:11.609 If you hover the cursor 266 00:14:11.609 --> 00:14:14.479 Then it show us which animation sequence is playing on that point 267 00:14:14.479 --> 00:14:17.279 In order to preview it 268 00:14:17.279 --> 00:14:22.039 You have to move this green x mark 269 00:14:22.039 --> 00:14:24.519 Press Ctrl on keyboard 270 00:14:24.519 --> 00:14:28.469 Once you press Ctrl then you can see 271 00:14:28.469 --> 00:14:31.080 X mark follows your cursor 272 00:14:31.080 --> 00:14:32.930 On the stage 273 00:14:32.930 --> 00:14:35.140 If I move to the left, it goes to left 274 00:14:35.140 --> 00:14:37.880 If I move to the right, it goes to the right 275 00:14:37.880 --> 00:14:39.080 and upward and downward 276 00:14:39.080 --> 00:14:42.430 Wait, I said left but isn't it moving to the right? 277 00:14:42.430 --> 00:14:44.480 Do not think that way 278 00:14:44.480 --> 00:14:47.440 You see like this on actual screen, forward from the back on viewport 279 00:14:47.440 --> 00:14:51.190 So when I move to the right, then right like this 280 00:14:51.190 --> 00:14:52.930 and left 281 00:14:52.930 --> 00:14:54.919 and forward 282 00:14:54.919 --> 00:14:59.259 and backward 283 00:14:59.259 --> 00:15:03.479 Now then save it 284 00:15:03.479 --> 00:15:07.379 and close BS_PistolMove 285 00:15:07.379 --> 00:15:08.679 Work is done 286 00:15:08.679 --> 00:15:11.720 That's it for creating movement animation asset 287 00:15:12.060 --> 00:15:16.214 Creating C Class and Editing Animation Blueprint 288 00:15:16.719 --> 00:15:20.529 Now let's create C class 289 00:15:20.529 --> 00:15:22.880 for control 290 00:15:22.880 --> 00:15:27.660 ABP_Manny, BS_PistolMove we created 291 00:15:27.660 --> 00:15:30.510 to control these appropriately 292 00:15:30.510 --> 00:15:32.080 we need control class 293 00:15:32.080 --> 00:15:35.680 So create a C class 294 00:15:35.680 --> 00:15:37.780 to settle this 295 00:15:37.780 --> 00:15:41.000 Move to C Classes folder on Content Browser 296 00:15:41.000 --> 00:15:43.039 and click right button 297 00:15:43.039 --> 00:15:46.689 And click New C Class 298 00:15:46.689 --> 00:15:50.429 As parent class for the class we will use 299 00:15:50.429 --> 00:15:52.520 choose All Classes 300 00:15:52.520 --> 00:15:54.970 and search 301 00:15:54.970 --> 00:15:58.270 AnimInstance here 302 00:15:58.270 --> 00:16:00.559 Then you get AnimInstance 303 00:16:00.559 --> 00:16:03.359 Choose it and click Next 304 00:16:03.359 --> 00:16:05.809 For newly created C class 305 00:16:05.809 --> 00:16:09.320 There is Public and Private button on Class Type here 306 00:16:09.320 --> 00:16:11.120 If you look at the path 307 00:16:11.120 --> 00:16:14.190 Where header file and cpp file 308 00:16:14.190 --> 00:16:16.039 will be created 309 00:16:16.039 --> 00:16:19.989 We made two type of folder when we created project 310 00:16:19.989 --> 00:16:22.719 which are Public and Private 311 00:16:22.719 --> 00:16:26.419 So automatically create them in there 312 00:16:26.419 --> 00:16:28.569 Class Type of the new things 313 00:16:28.569 --> 00:16:32.039 There are Public and Private 314 00:16:32.039 --> 00:16:36.789 So basically header file goes into Public 315 00:16:36.789 --> 00:16:41.880 and cpp file goes into Private folder 316 00:16:41.880 --> 00:16:45.780 So make it like this and set 317 00:16:45.780 --> 00:16:48.919 Name of this class file to NetPlayerAnimInstance 318 00:16:48.919 --> 00:16:53.000 Then click Create Class 319 00:16:53.000 --> 00:16:59.600 Then NetPlayerAnimInstance class is created on Visual Studio 320 00:16:59.600 --> 00:17:03.080 and choose reload all 321 00:17:03.080 --> 00:17:06.470 So everything is created and compiled 322 00:17:06.470 --> 00:17:09.740 Now I'm going to add new property 323 00:17:09.740 --> 00:17:11.880 at NetPlayerAnimInstance 324 00:17:11.880 --> 00:17:16.199 That's because we added new animation 325 00:17:16.199 --> 00:17:18.699 There are animation holding guns and 326 00:17:18.699 --> 00:17:21.439 animation without guns 327 00:17:21.439 --> 00:17:23.989 If you play it, it doesn't hold gun now 328 00:17:23.989 --> 00:17:27.089 In order to tell when the animation with guns should be played 329 00:17:27.089 --> 00:17:31.079 in order to tell this 330 00:17:31.079 --> 00:17:34.129 I'm going to add member property 331 00:17:34.129 --> 00:17:39.319 So move to NetPlayerAnimInstance header file 332 00:17:39.319 --> 00:17:42.219 You can find it on Solution Explorer 333 00:17:42.219 --> 00:17:46.280 Double click NetPlayerAnimInstance header file to open 334 00:17:46.280 --> 00:17:52.580 In here, let's add 335 00:17:52.580 --> 00:17:57.779 Whether player has a gun or not as public 336 00:17:57.779 --> 00:18:04.579 Let's add member variable remembering 337 00:18:04.579 --> 00:18:06.959 Whether the character has a gun or not 338 00:18:06.959 --> 00:18:09.809 Set type to bool 339 00:18:09.809 --> 00:18:13.079 bHasPistol 340 00:18:13.079 --> 00:18:17.629 It won't have it so assign false 341 00:18:17.629 --> 00:18:22.880 But I want this value to be connected to blueprint to work 342 00:18:22.880 --> 00:18:28.030 Then this member variable in C class 343 00:18:28.030 --> 00:18:31.479 needs to be introduced to unreal engine 344 00:18:31.479 --> 00:18:35.629 So in order to let unreal engine know 345 00:18:35.629 --> 00:18:36.760 Type this 346 00:18:36.760 --> 00:18:43.560 UPROPERTY(EditAnywhere) 347 00:18:43.560 --> 00:18:48.199 Then this bHasPistol can be edited from anywhere 348 00:18:48.199 --> 00:18:50.399 This would be in unreal engine 349 00:18:50.399 --> 00:18:57.040 Then this can be read and written from Blueprint 350 00:18:57.040 --> 00:18:59.520 Then Category 351 00:18:59.520 --> 00:19:03.520 For category bHasPistol will be exposed 352 00:19:03.520 --> 00:19:08.319 I'll say MyAnimSettings 353 00:19:08.319 --> 00:19:12.029 Then when it is shown, bHasPistol will be shown 354 00:19:12.029 --> 00:19:14.959 under the MyAnimSettings category 355 00:19:14.959 --> 00:19:17.729 This type of setting is called reflection 356 00:19:17.729 --> 00:19:23.359 In object oriented language, in language which has virtual machine 357 00:19:23.359 --> 00:19:25.509 Such as C# or JAVA 358 00:19:25.509 --> 00:19:28.509 This part is done automatically in some degree 359 00:19:28.509 --> 00:19:31.839 But C based language such as Unreal Engine 360 00:19:31.839 --> 00:19:33.889 In order to connect this properties I have 361 00:19:33.889 --> 00:19:37.689 to Unreal Engine or other things 362 00:19:37.689 --> 00:19:41.199 We have to use some technique to solve it 363 00:19:41.199 --> 00:19:43.199 These are called reflection 364 00:19:43.199 --> 00:19:45.599 and where all these part is saved to 365 00:19:45.599 --> 00:19:51.800 is NetPlayerAnimInstance.generated.h file 366 00:19:51.800 --> 00:19:54.430 Information about this class 367 00:19:54.430 --> 00:19:58.439 go up to there in the form of UCLASS 368 00:19:58.439 --> 00:20:01.089 Base on those information, unreal engine 369 00:20:01.089 --> 00:20:03.839 know what kind of information is in this class 370 00:20:03.839 --> 00:20:06.739 what properties and funcions are in here 371 00:20:06.739 --> 00:20:08.800 and it can use them 372 00:20:08.800 --> 00:20:10.550 But it can not use them without any condition 373 00:20:10.550 --> 00:20:13.800 Property needs Macros function called UPROPERTY 374 00:20:13.800 --> 00:20:18.840 and function needs UFUNCTION 375 00:20:18.840 --> 00:20:22.719 And I finished to add like this 376 00:20:22.719 --> 00:20:24.739 Then let me build it once 377 00:20:28.599 --> 00:20:31.149 Normally, after compile 378 00:20:31.149 --> 00:20:34.049 You should let unreal engine know about header 379 00:20:34.049 --> 00:20:36.449 For constructor file 380 00:20:36.449 --> 00:20:38.880 For constructor function, if it is edited 381 00:20:38.880 --> 00:20:41.580 You should let unreal engine know 382 00:20:41.580 --> 00:20:43.430 Basically it is automated to be notified 383 00:20:43.430 --> 00:20:45.390 Via function called Hot Reload 384 00:20:45.390 --> 00:20:47.680 It is updated automatically 385 00:20:47.680 --> 00:20:49.380 But there are many cases not working well 386 00:20:49.380 --> 00:20:50.960 Such as this 387 00:20:50.960 --> 00:20:54.110 When the property is added to header 388 00:20:54.110 --> 00:20:56.040 or change this value on header 389 00:20:56.040 --> 00:20:58.560 There are many cases editor doesn't notice 390 00:20:58.560 --> 00:21:00.199 This value has been edited 391 00:21:00.199 --> 00:21:02.349 So usually, when some values 392 00:21:02.349 --> 00:21:04.549 are added to header or so 393 00:21:04.549 --> 00:21:07.760 It's good to close and restart the editor 394 00:21:07.760 --> 00:21:09.790 When you are working with Unreal Engine 395 00:21:09.790 --> 00:21:13.419 So restart it 396 00:21:13.419 --> 00:21:16.119 Then as unreal engine start 397 00:21:16.119 --> 00:21:22.119 All the added or edited things are reflected normally 398 00:21:22.119 --> 00:21:25.969 Commonly, some function logic we work 399 00:21:25.969 --> 00:21:28.359 are reflected well when we edit it 400 00:21:28.359 --> 00:21:30.709 But when we change or add 401 00:21:30.709 --> 00:21:34.059 Values of properties of constructor function or so 402 00:21:34.059 --> 00:21:37.680 It's good to restart the unreal engine editor 403 00:21:37.680 --> 00:21:40.880 In here, double click 404 00:21:40.880 --> 00:21:44.640 to open this ABP_Manny 405 00:21:44.640 --> 00:21:49.520 Which is in Animations folder under the NetTPS 406 00:21:49.520 --> 00:21:51.320 Open it like this 407 00:21:51.320 --> 00:21:54.670 Now what is the parent class 408 00:21:54.670 --> 00:21:56.620 of this ABP_Manny 409 00:21:56.620 --> 00:21:58.640 If you look at right top 410 00:21:58.640 --> 00:22:02.090 It says AnimInstance 411 00:22:02.090 --> 00:22:05.239 It says Parent class is AnimInstance 412 00:22:05.239 --> 00:22:08.089 It's not NetPlayAnimInstance we created 413 00:22:08.089 --> 00:22:12.160 Parent class is set to AnimInstance class which is just the highest class 414 00:22:12.160 --> 00:22:16.640 So we have to change it to what we created 415 00:22:16.640 --> 00:22:20.640 So go to Class Settings, this button here 416 00:22:20.640 --> 00:22:22.640 Click Class Settings button 417 00:22:22.640 --> 00:22:25.920 There is Parent Class on Details window on the right 418 00:22:25.920 --> 00:22:27.920 Change this AnimInstance of this Parent Class 419 00:22:27.920 --> 00:22:33.420 to NetPlayerAnimInstance class 420 00:22:33.420 --> 00:22:34.959 we created 421 00:22:34.959 --> 00:22:40.359 Now if we go and look then 422 00:22:40.359 --> 00:22:44.109 This member variable bHasPistol, this property we added 423 00:22:44.109 --> 00:22:46.779 has to be shown under the VARIABLES 424 00:22:46.779 --> 00:22:49.800 On My Blueprint window 425 00:22:49.800 --> 00:22:53.750 If you can't find it, then you have to add it 426 00:22:53.750 --> 00:22:57.439 There is gear icon on My Blueprint 427 00:22:57.439 --> 00:22:59.239 Click it 428 00:22:59.239 --> 00:23:02.489 Then there is Show Inherited Variables option 429 00:23:02.489 --> 00:23:06.560 This is the option to show variables of parent 430 00:23:06.560 --> 00:23:09.310 Check this 431 00:23:09.310 --> 00:23:12.319 Now we have My Anim Settings on My Blueprint 432 00:23:12.319 --> 00:23:15.469 Under this category, property Has Pistol 433 00:23:15.469 --> 00:23:19.359 We added is shown 434 00:23:19.359 --> 00:23:22.629 This was the content 435 00:23:22.629 --> 00:23:25.719 to create C class to control 436 00:23:25.760 --> 00:23:29.040 Now let's edit animation blueprint 437 00:23:29.040 --> 00:23:31.140 By using this Has Pistol we added 438 00:23:31.140 --> 00:23:33.880 Let's edit animation blueprint 439 00:23:33.880 --> 00:23:36.180 Here is AnimGraph 440 00:23:36.180 --> 00:23:39.160 There is AnimGraph tab in ABP_Manny 441 00:23:39.160 --> 00:23:41.080 Or if you can't find it, then go to My Blueprint 442 00:23:41.080 --> 00:23:44.000 There will be AnimGraph 443 00:23:44.000 --> 00:23:46.450 Here is AnimGraph on My Blueprint 444 00:23:46.450 --> 00:23:49.199 Double click it to open it 445 00:23:49.199 --> 00:23:51.599 Then it is opened 446 00:23:51.599 --> 00:23:56.580 There is Locomotion node 447 00:23:56.580 --> 00:23:58.030 Double click it 448 00:23:58.030 --> 00:24:00.980 Or Locomotion under the AnimGraph 449 00:24:00.980 --> 00:24:03.539 You can double click this, it's same 450 00:24:03.539 --> 00:24:06.199 If you double click Locomotion 451 00:24:06.199 --> 00:24:11.129 Then you can get in to Locomotion tab in AnimGraph 452 00:24:11.129 --> 00:24:12.920 in ABP_Manny 453 00:24:12.920 --> 00:24:16.170 Idle animation and Walk and Run 454 00:24:16.170 --> 00:24:19.190 Walking and running animations are 455 00:24:19.190 --> 00:24:21.599 Working normally 456 00:24:21.599 --> 00:24:23.549 by using state machine 457 00:24:23.549 --> 00:24:27.069 When player has pistol we add 458 00:24:27.069 --> 00:24:30.079 We can't use this for walking, running 459 00:24:30.079 --> 00:24:31.329 and standing still animation 460 00:24:31.329 --> 00:24:34.779 Therefore we have to add and create one 461 00:24:34.779 --> 00:24:37.359 So here is Entry node 462 00:24:37.359 --> 00:24:42.709 Disconnect this transition arrow from Entry node 463 00:24:42.709 --> 00:24:46.359 to Idle by pressing Alt and left click 464 00:24:46.359 --> 00:24:48.009 It can not go towards this regardless of condition 465 00:24:48.009 --> 00:24:51.189 Here is where animation is played 466 00:24:51.189 --> 00:24:56.000 And FSM state machine is working when player has no pistol 467 00:24:56.000 --> 00:25:00.400 When player has pistol, we'll make something else execute 468 00:25:00.400 --> 00:25:02.350 Then there are 2 cases 469 00:25:02.350 --> 00:25:05.800 When player has pistol or has not 470 00:25:05.800 --> 00:25:07.600 Therefore in order to process branch 471 00:25:07.600 --> 00:25:09.400 Some technique is added to Unreal Engine 5 472 00:25:09.400 --> 00:25:11.199 If you click right button 473 00:25:11.199 --> 00:25:13.699 There is Add Conduit Let me explain it 474 00:25:13.699 --> 00:25:15.249 As you see 475 00:25:15.249 --> 00:25:17.839 This pipe, tube thing is conduit 476 00:25:17.839 --> 00:25:20.039 This is called conduit 477 00:25:20.039 --> 00:25:23.339 and some animation we want to use 478 00:25:23.339 --> 00:25:24.729 is not only go to one direction 479 00:25:24.729 --> 00:25:26.839 But want it to flow 480 00:25:26.839 --> 00:25:29.619 through these pipes 481 00:25:29.619 --> 00:25:34.119 So add Conduit node 482 00:25:34.119 --> 00:25:38.540 and name of this Conduit node 483 00:25:38.540 --> 00:25:41.310 is Has Pistol 484 00:25:41.310 --> 00:25:43.410 You see there is icon 485 00:25:43.410 --> 00:25:46.280 It looks like duct, pipe 486 00:25:46.280 --> 00:25:48.480 So this can decide destination 487 00:25:48.480 --> 00:25:50.830 depends on input signal 488 00:25:50.830 --> 00:25:53.880 So connect Entry node 489 00:25:53.880 --> 00:25:55.980 to Has Pistol 490 00:25:55.980 --> 00:25:58.880 Then connect Has Pistol 491 00:25:58.880 --> 00:26:01.920 to Idle like this 492 00:26:01.920 --> 00:26:05.320 Then when player doesn't have a pistol 493 00:26:05.320 --> 00:26:08.599 Then upper one will be played 494 00:26:08.599 --> 00:26:12.099 There is Asset Browser on the right bottom 495 00:26:12.099 --> 00:26:14.349 If you don't see Asset Browser as well 496 00:26:14.349 --> 00:26:18.139 Choose Asset Browser form Window menu 497 00:26:18.139 --> 00:26:25.760 Search BS_PistolMove we worked 498 00:26:25.760 --> 00:26:28.910 Find BS_PistolMove we worked 499 00:26:28.910 --> 00:26:33.319 and drag and drop to add 500 00:26:33.319 --> 00:26:39.119 BS_PistolMove is animation with pistol 501 00:26:39.119 --> 00:26:41.800 Grab Has Pistol 502 00:26:41.800 --> 00:26:45.439 and connect to this 503 00:26:45.439 --> 00:26:50.039 Then when player doesn't have a pistol, animation above will be executed 504 00:26:50.039 --> 00:26:53.240 and when player has a pistol, below one 505 00:26:53.240 --> 00:26:55.440 will be executed 506 00:26:55.440 --> 00:26:57.900 Then here 507 00:26:57.900 --> 00:27:02.770 There is a case we have to go back from Idle to Has Pistol 508 00:27:02.770 --> 00:27:07.000 We didn't have a pistol and we pressed grab pistol button 509 00:27:07.000 --> 00:27:08.850 Then we have to grab pistol 510 00:27:08.850 --> 00:27:12.040 Then below one has to be executed 511 00:27:12.040 --> 00:27:16.920 In other words, running with nothing then grab pistol 512 00:27:16.920 --> 00:27:19.070 Then animation below needs to be executed 513 00:27:19.070 --> 00:27:21.439 Not above one 514 00:27:21.439 --> 00:27:27.189 So go back from Idle to Has Pistol 515 00:27:27.189 --> 00:27:30.280 and from Has Pistol to here 516 00:27:30.280 --> 00:27:31.680 And another case 517 00:27:31.680 --> 00:27:34.730 Moving with pistol then drop pistol 518 00:27:34.730 --> 00:27:39.680 Then animation above needs to be executed 519 00:27:39.680 --> 00:27:46.030 So go back from BS_PistolMove to Has Pistol 520 00:27:46.030 --> 00:27:48.580 Then go to this way 521 00:27:48.580 --> 00:27:50.800 This structure needs to be made 522 00:27:50.800 --> 00:27:55.050 This Has Pistol node 523 00:27:55.050 --> 00:27:59.720 Double click this Conduit node to open 524 00:27:59.720 --> 00:28:02.170 In this Conduit node 525 00:28:02.170 --> 00:28:04.370 It says Can Enter Transition, this is option 526 00:28:04.370 --> 00:28:07.680 Whether you'd like to make this transition work normally or not 527 00:28:07.680 --> 00:28:10.730 I'll check this to make it work no matter 528 00:28:10.730 --> 00:28:16.920 Again, double clicked Has Pistol node from Locomotion 529 00:28:16.920 --> 00:28:20.190 Then it means start from entry through Has Pistol node 530 00:28:20.190 --> 00:28:23.160 Make transition to go somewhere 531 00:28:23.160 --> 00:28:25.560 So check Has Pistol node regardless 532 00:28:25.560 --> 00:28:28.560 to make transition go 533 00:28:28.560 --> 00:28:32.000 Then back to Locomotion 534 00:28:32.000 --> 00:28:34.650 When transition go from Has Pistol to Idle 535 00:28:34.650 --> 00:28:38.640 And when it go from Has Pistol to BS_PistolMove 536 00:28:38.640 --> 00:28:42.240 When not holding pistol, go to Idle 537 00:28:42.240 --> 00:28:43.840 There is rule here 538 00:28:43.840 --> 00:28:45.880 There is this rule, condition button of transition 539 00:28:45.880 --> 00:28:49.659 Double click this to open 540 00:28:49.659 --> 00:28:54.659 Then the condition transition have to go from Has Pistol to Idle is 541 00:28:54.659 --> 00:28:58.509 Has Pistol on My Blueprint on left bottom 542 00:28:58.509 --> 00:29:03.679 is member variable about whether or not player has a pistol 543 00:29:03.679 --> 00:29:07.880 How is it if it doesn’t have a pistol 544 00:29:07.880 --> 00:29:11.680 It needs to be switched to default animation Idle without pistol 545 00:29:11.680 --> 00:29:13.480 So the value of Has Pistol 546 00:29:13.480 --> 00:29:16.520 I pressed Ctrl to add it like this 547 00:29:16.520 --> 00:29:19.470 Grab data pin and pull 548 00:29:19.470 --> 00:29:21.770 and type ! 549 00:29:21.770 --> 00:29:24.599 Choose NOT Boolean when it is not 550 00:29:24.599 --> 00:29:30.400 This value proceed when it is not 551 00:29:30.400 --> 00:29:34.150 Transition go from Has Pistol to Idle 552 00:29:34.150 --> 00:29:37.599 When player doesn't have a pistol, let's process this way 553 00:29:37.599 --> 00:29:39.029 Back to Locomotion 554 00:29:39.029 --> 00:29:43.000 Then when transition come back from Idle to Has Pistol 555 00:29:43.000 --> 00:29:46.150 How is it when player holds a pistol 556 00:29:46.150 --> 00:29:48.119 Transition have to go this way 557 00:29:48.119 --> 00:29:52.119 Click this condition button on Has Pistol 558 00:29:52.119 --> 00:29:57.369 When is it this time, when Has Pistol is true 559 00:29:57.369 --> 00:30:02.199 When player have a pistol it has to come back from Idle to Has Pistol 560 00:30:02.199 --> 00:30:03.949 Come back to Locomotion 561 00:30:03.949 --> 00:30:06.899 This time from Has Pistol to BS_PistolMove 562 00:30:06.899 --> 00:30:09.199 How to go to the state having pistol 563 00:30:09.199 --> 00:30:13.179 When having pistol, this condition button of transition 564 00:30:13.179 --> 00:30:17.239 Double click it again 565 00:30:17.920 --> 00:30:22.700 Put Has Pistol variabel 566 00:30:22.700 --> 00:30:24.160 to Can Enter Transition like this 567 00:30:24.160 --> 00:30:26.210 Then come back to Locomotion 568 00:30:26.210 --> 00:30:29.960 Transition needs to go from BS_PistolMove to Idle 569 00:30:29.960 --> 00:30:33.599 So it's when Has Pistol is not 570 00:30:33.599 --> 00:30:36.349 It has to go this way when player doesn’t have pistol 571 00:30:36.349 --> 00:30:40.049 So this time, select condition button 572 00:30:40.049 --> 00:30:44.280 towards Has Pistol node and double click 573 00:30:44.280 --> 00:30:46.530 Bring Has Pistol node again 574 00:30:46.530 --> 00:30:51.199 When it's not, !Not Boolean 575 00:30:51.199 --> 00:30:52.749 Connect like this 576 00:30:52.749 --> 00:30:56.959 Then Locomotion looks like this now 577 00:30:56.959 --> 00:30:59.539 Compile it and how is it? 578 00:30:59.539 --> 00:31:01.839 It became like this as we save it 579 00:31:01.839 --> 00:31:05.479 If you see this, how is Has Pistol 580 00:31:05.479 --> 00:31:10.029 It says cannot be used 581 00:31:10.029 --> 00:31:13.280 On Entry node, how it happens 582 00:31:13.280 --> 00:31:15.680 There is AnimGraph 583 00:31:15.680 --> 00:31:18.719 Let's move AnimGraph node again 584 00:31:18.719 --> 00:31:20.769 After move to AnimGraph node 585 00:31:20.769 --> 00:31:23.369 Select this Locomotion 586 00:31:23.369 --> 00:31:25.169 Select Locomotion 587 00:31:25.169 --> 00:31:28.160 On Details window on the right 588 00:31:28.160 --> 00:31:32.260 Under the Settings category 589 00:31:32.260 --> 00:31:34.599 There is Allow Conduit Entry States 590 00:31:34.599 --> 00:31:38.799 Option asking about using Conduit as Entry States 591 00:31:38.799 --> 00:31:41.880 is unchecked, if you check it 592 00:31:41.880 --> 00:31:43.230 You can use it 593 00:31:43.230 --> 00:31:46.080 Click compile button again and now it's normal 594 00:31:46.080 --> 00:31:49.119 How is it now? It's working 595 00:31:49.119 --> 00:31:52.019 We can keep this part 596 00:31:52.019 --> 00:31:55.369 And there is a thing we should think about 597 00:31:55.369 --> 00:31:57.520 So let's do it one more 598 00:31:57.520 --> 00:31:59.970 Go back to Locomotion 599 00:31:59.970 --> 00:32:02.020 in Locomotion again 600 00:32:02.020 --> 00:32:07.479 Let's say it's running on Idle 601 00:32:07.479 --> 00:32:11.639 Running without pistol 602 00:32:11.639 --> 00:32:16.239 We pressed grab pistol button while running 603 00:32:16.239 --> 00:32:21.839 Then it has to be changed to grabbing animation 604 00:32:21.839 --> 00:32:25.339 But if you see current state transition 605 00:32:25.339 --> 00:32:30.799 From Idle, transition can move through Has Pistol 606 00:32:30.799 --> 00:32:34.479 But Walk and Run don't have a way to go 607 00:32:34.479 --> 00:32:37.479 It has to go back to Idle 608 00:32:37.479 --> 00:32:41.959 But player is keep running so it will be running state 609 00:32:41.959 --> 00:32:44.859 There is no way to go to here 610 00:32:44.859 --> 00:32:49.009 When you are not holding pistol, no matter what state is 611 00:32:49.009 --> 00:32:52.839 If you grab pistol, you want to move to here 612 00:32:52.839 --> 00:32:55.539 To settle this 613 00:32:55.539 --> 00:32:59.719 We can add and use node called State Alias 614 00:32:59.719 --> 00:33:04.419 No matter what state is, help us to move to the state we want 615 00:33:04.419 --> 00:33:07.520 Let me add this 616 00:33:07.520 --> 00:33:09.420 Click right button 617 00:33:09.420 --> 00:33:12.320 There is Add State Alias 618 00:33:12.320 --> 00:33:15.439 Choose this to add 619 00:33:15.439 --> 00:33:19.620 Set name of this node to Any State 620 00:33:19.640 --> 00:33:22.990 In any state, such as while running 621 00:33:22.990 --> 00:33:25.040 Grab a pistol in any state 622 00:33:25.040 --> 00:33:27.000 I want to make it move to here 623 00:33:27.000 --> 00:33:29.930 and it can only move from Idle now 624 00:33:29.930 --> 00:33:34.280 But in this state, make it able to move to BS_Pistol 625 00:33:34.280 --> 00:33:36.439 I want to process that therefore Any State 626 00:33:36.439 --> 00:33:40.639 Make it able to go to BS_Pistol from any state 627 00:33:40.639 --> 00:33:42.039 That's what it is 628 00:33:42.039 --> 00:33:45.640 Select Any State and go to the right 629 00:33:45.640 --> 00:33:47.140 On Details window 630 00:33:47.140 --> 00:33:50.390 When do you want to go to BS_Pistol 631 00:33:50.390 --> 00:33:54.439 BS_Pistol doesn't need to go to itself when player already holding a pistol 632 00:33:54.439 --> 00:33:55.789 When running 633 00:33:55.789 --> 00:33:58.169 Let's just check Idle as well 634 00:33:58.169 --> 00:34:00.569 Then when player doesn't have a pistol 635 00:34:00.569 --> 00:34:04.040 I made Any State can be enabled 636 00:34:04.040 --> 00:34:08.320 Global Alias includes all of the states 637 00:34:08.320 --> 00:34:13.259 We chose Any State and checked Idel, Walk and Run 638 00:34:13.259 --> 00:34:15.359 That's good 639 00:34:15.359 --> 00:34:18.809 Condition that Any State can be enabled in any state is good 640 00:34:18.809 --> 00:34:23.739 Then we need transition condition for Any State to go to BS_Pistol 641 00:34:23.739 --> 00:34:27.239 So that get signal in any state 642 00:34:27.239 --> 00:34:28.589 and go to BS_Pistol 643 00:34:28.589 --> 00:34:31.039 So select this transition button 644 00:34:31.039 --> 00:34:33.760 When this should active 645 00:34:33.760 --> 00:34:37.910 That's when Has Pistol is true 646 00:34:37.910 --> 00:34:41.959 When player has a pistol if this signal comes in 647 00:34:41.959 --> 00:34:44.759 Then make BS_Pistol work right away 648 00:34:44.759 --> 00:34:47.009 If player doesn't have a pistol then automatically 649 00:34:47.009 --> 00:34:49.800 Go to Has Pistol then to Idle 650 00:34:49.800 --> 00:34:52.200 Click compile button 651 00:34:52.200 --> 00:34:55.800 Now everything set correctly so let's test it 652 00:34:55.800 --> 00:34:57.650 Here is Anim Preview Editor 653 00:34:57.650 --> 00:35:01.550 If you don't see it then there is Anim Preview Editor on Window menu 654 00:35:01.550 --> 00:35:03.479 Click this to open window 655 00:35:03.479 --> 00:35:05.879 To test about switching animation 656 00:35:05.879 --> 00:35:08.919 When player has a pistol 657 00:35:08.919 --> 00:35:12.769 There is Has Pistol on Edit Preview 658 00:35:12.769 --> 00:35:18.439 Check this then it grabs a pistol 659 00:35:18.439 --> 00:35:23.089 You could see it on preview viewport window 660 00:35:23.089 --> 00:35:25.089 Has Pistol 661 00:35:25.089 --> 00:35:27.600 We are at here now 662 00:35:27.600 --> 00:35:30.780 If we check and uncheck Has Pistol here 663 00:35:30.780 --> 00:35:34.360 Then this value would change on this preview window 664 00:35:34.360 --> 00:35:36.060 Let me uncheck it this time 665 00:35:36.060 --> 00:35:37.610 Check it, uncheck it 666 00:35:37.610 --> 00:35:41.239 You can see it's working well 667 00:35:41.239 --> 00:35:46.739 Now if you have edited animation blueprint like this 668 00:35:46.739 --> 00:35:47.989 Make this little bit more 669 00:35:47.989 --> 00:35:51.480 able to extend and use animation bluprint 670 00:35:51.480 --> 00:35:54.080 Add velocity on running 671 00:35:54.080 --> 00:35:56.880 Add stuff to make velocity 672 00:35:56.880 --> 00:36:00.380 applied to BS_PistolMove on left and right 673 00:36:00.380 --> 00:36:02.159 forward and backword 674 00:36:02.159 --> 00:36:04.159 If you go into BS_Pistol 675 00:36:04.159 --> 00:36:08.679 It has no value of Direction and Speed for animation to switch 676 00:36:08.679 --> 00:36:11.999 Some value has to given to switch animation 677 00:36:11.999 --> 00:36:13.649 But it doesn't have that part now 678 00:36:13.649 --> 00:36:16.919 So let's add that part 679 00:36:16.919 --> 00:36:21.069 Animation blueprint need little more of edited content 680 00:36:21.069 --> 00:36:22.679 and that is here 681 00:36:22.679 --> 00:36:26.629 In here, we need Speed and Direction 682 00:36:26.629 --> 00:36:29.679 to control animation 683 00:36:29.679 --> 00:36:31.479 So let's add that part here 684 00:36:31.479 --> 00:36:35.429 If you press Ctrl D one line is duplicated 685 00:36:35.429 --> 00:36:37.199 I duplicated this 686 00:36:37.199 --> 00:36:41.189 In here, I'm going to give value 687 00:36:41.189 --> 00:36:42.560 of left and right first 688 00:36:42.560 --> 00:36:46.410 Write float direction 689 00:36:46.410 --> 00:36:52.520 Press Ctrl D once more and float speed this time 690 00:36:52.520 --> 00:36:55.420 Then what we are trying to use here 691 00:36:55.420 --> 00:36:57.720 What we are trying to use in BS_PistolMove 692 00:36:57.720 --> 00:37:02.439 We declared variables correspond to Direction and Speed 693 00:37:02.439 --> 00:37:07.919 Build to apply this value 694 00:37:07.919 --> 00:37:10.719 Once you build it 695 00:37:10.719 --> 00:37:13.369 When this is added, usually we need to restart editor 696 00:37:13.369 --> 00:37:16.760 But I think it could be work normal using this window 697 00:37:16.760 --> 00:37:20.010 If you think errors are occur, then restart editor 698 00:37:20.010 --> 00:37:22.010 Usually just restart it as if it is a habit 699 00:37:22.010 --> 00:37:24.239 It's good for you when you work like this 700 00:37:24.239 --> 00:37:27.089 Whenever you work with engine, even if it is annoying 701 00:37:27.089 --> 00:37:29.739 Shut down and restart apps frequently 702 00:37:29.739 --> 00:37:32.399 is a help on preventing errors 703 00:37:32.399 --> 00:37:36.049 It is applied right away so we're just going to continue 704 00:37:36.049 --> 00:37:39.349 Drag and drop to attach 705 00:37:39.349 --> 00:37:41.840 Direction to BS_PistolMove 706 00:37:41.840 --> 00:37:44.990 and drag and drop to attach Speed to here 707 00:37:44.990 --> 00:37:47.800 Then value of Direction and Speed 708 00:37:47.800 --> 00:37:50.850 We declared as member variable 709 00:37:50.850 --> 00:37:53.800 can be applied on BS_PistolMove noramlly 710 00:37:53.800 --> 00:37:55.239 Compile it 711 00:37:55.239 --> 00:37:59.489 If you want to see how it work when the values are changed 712 00:37:59.489 --> 00:38:01.209 We have Anim Preview Editor here 713 00:38:01.209 --> 00:38:04.919 Change those values here 714 00:38:04.919 --> 00:38:07.269 If you change this value, wait nothing changed 715 00:38:07.269 --> 00:38:12.240 That's because Has Pistol needs to be checked 716 00:38:12.240 --> 00:38:13.740 Once Has Pistol is checked 717 00:38:13.740 --> 00:38:17.400 You would be able to see it moving 718 00:38:17.400 --> 00:38:19.300 It can move backward 719 00:38:19.300 --> 00:38:21.700 If you change the value to minus 720 00:38:21.700 --> 00:38:22.950 It can move forward 721 00:38:22.950 --> 00:38:26.120 You can see this visually 722 00:38:26.120 --> 00:38:28.570 If you uncheck Has Pistol, it's not applied 723 00:38:28.570 --> 00:38:32.570 Then to make these values of Direction and Speed applied 724 00:38:32.570 --> 00:38:36.239 We will add to script 725 00:38:36.239 --> 00:38:39.439 Let's edit C class 726 00:38:39.439 --> 00:38:41.840 Go to Visual Studio 727 00:38:41.840 --> 00:38:46.990 First, the animation is, we have to take 728 00:38:46.990 --> 00:38:49.490 values from character 729 00:38:49.490 --> 00:38:51.879 through NetTPSCharacter to apply to animation 730 00:38:51.879 --> 00:38:54.429 such as how fast the character is 731 00:38:54.429 --> 00:38:55.779 running right now 732 00:38:55.779 --> 00:38:58.439 Take velocity and process or so 733 00:38:58.439 --> 00:39:01.389 So we need a way to have this NetTPSCharacter 734 00:39:01.389 --> 00:39:04.789 As member to get values from there 735 00:39:04.789 --> 00:39:06.399 and use it 736 00:39:06.399 --> 00:39:09.399 Therefore add instance 737 00:39:09.399 --> 00:39:12.339 of NetTPSCharacter 738 00:39:12.339 --> 00:39:14.199 As member variable here 739 00:39:14.199 --> 00:39:21.599 Write class ANetTPSCharacter* player 740 00:39:21.599 --> 00:39:23.399 to add variable player as the type of ANetTPSCharacter* 741 00:39:23.399 --> 00:39:24.849 When the pointer is attached 742 00:39:24.849 --> 00:39:27.199 In order to get memory managed by unreal engine 743 00:39:27.199 --> 00:39:32.239 Add UPROPERTY() 744 00:39:32.239 --> 00:39:34.989 Now then when the player reference become 0 745 00:39:34.989 --> 00:39:36.839 When reference counter hit 0 746 00:39:36.839 --> 00:39:39.089 Then my player character itself 747 00:39:39.089 --> 00:39:41.280 is removed from memory 748 00:39:41.280 --> 00:39:44.730 by Unreal Engine 749 00:39:44.730 --> 00:39:48.679 You have to add UPROPERTY() to pointer 750 00:39:48.679 --> 00:39:52.429 We need place where this player is assigned 751 00:39:52.429 --> 00:39:55.229 and Direction and Speed will be assigned 752 00:39:55.229 --> 00:39:56.560 stuff like that 753 00:39:56.560 --> 00:39:59.380 In order that let me add 754 00:39:59.380 --> 00:40:00.630 2 lifecycle function 755 00:40:00.630 --> 00:40:03.520 public: 756 00:40:03.520 --> 00:40:07.270 First, add virtual void NativeInitializeAnimation function 757 00:40:07.270 --> 00:40:15.379 Which is similar to BeginPlay function 758 00:40:15.379 --> 00:40:19.579 This function is called when this class is called 759 00:40:19.579 --> 00:40:22.320 at the beginning 760 00:40:22.320 --> 00:40:30.620 Next, virtual void NativeUpdateAnimation 761 00:40:30.620 --> 00:40:34.600 We will override these 2 functions to use 762 00:40:34.600 --> 00:40:37.350 InitializeAnimation is called once 763 00:40:37.350 --> 00:40:39.150 and UpdateAnimation will be called 764 00:40:39.150 --> 00:40:41.150 progressively while animation is playing 765 00:40:41.150 --> 00:40:43.320 just like ticks 766 00:40:43.320 --> 00:40:48.560 Add implementation block 767 00:40:49.439 --> 00:40:54.719 of NativeInitializeAnimation to cpp file 768 00:40:54.719 --> 00:40:57.519 NativeUpdateAnimation from header file 769 00:40:57.519 --> 00:41:01.919 Add this function as well 770 00:41:01.919 --> 00:41:08.679 Implementation blocks are added in cpp file 771 00:41:08.679 --> 00:41:12.129 These two file have things 772 00:41:12.129 --> 00:41:16.320 to process by calling internally from parent class 773 00:41:16.320 --> 00:41:19.070 Therefore overridden functions 774 00:41:19.070 --> 00:41:22.520 have to add Super 775 00:41:22.520 --> 00:41:26.600 And call NativeInitializeAnimation 776 00:41:26.600 --> 00:41:29.120 parent have 777 00:41:29.120 --> 00:41:34.270 Same for below, add Super and NativeUpdateAnimation 778 00:41:34.270 --> 00:41:38.220 to get processed 779 00:41:38.220 --> 00:41:39.919 this part 780 00:41:39.919 --> 00:41:44.319 First, NativeInitializeAnimation 781 00:41:44.319 --> 00:41:47.199 This is initialization function 782 00:41:47.199 --> 00:41:50.699 This function is about how it would be initialized 783 00:41:50.699 --> 00:41:53.919 When this NetPlayerAninInstance class is initialized 784 00:41:53.919 --> 00:41:55.269 In here 785 00:41:55.269 --> 00:41:58.719 I will initialize instance 786 00:41:58.719 --> 00:42:01.560 of NetTPSCharacter here 787 00:42:01.560 --> 00:42:08.660 Initialize instance 788 00:42:08.660 --> 00:42:10.360 of NetTPSCharacter 789 00:42:10.360 --> 00:42:13.760 Which means I will get and use it 790 00:42:13.760 --> 00:42:19.210 This NetPlayerAnimInstance is ABP_Manny 791 00:42:19.210 --> 00:42:22.120 Because parent class is NetPlayerAnimInstance 792 00:42:22.120 --> 00:42:26.570 Then the class having this ABP_Manny is 793 00:42:26.570 --> 00:42:30.560 BP_ThirdPersonCharacter blueprint class 794 00:42:30.560 --> 00:42:32.060 Why? 795 00:42:32.060 --> 00:42:34.910 If you look at Mesh Component from Components 796 00:42:34.910 --> 00:42:38.360 It is using ABP_Manny as Anim Class on the right 797 00:42:38.360 --> 00:42:42.460 Which means this character is using this class to control this animation 798 00:42:42.460 --> 00:42:46.919 Therefore bring NetTPSCharacter which this is owned by 799 00:42:46.919 --> 00:42:49.969 and process velocity and so 800 00:42:49.969 --> 00:42:56.040 So let's process initialization here 801 00:42:56.040 --> 00:42:59.840 This is instance on header file 802 00:42:59.840 --> 00:43:00.690 Like this 803 00:43:00.690 --> 00:43:03.719 This player is not assigned anything 804 00:43:03.719 --> 00:43:05.019 It's nullptr 805 00:43:05.019 --> 00:43:07.909 Let's assign value to this 806 00:43:07.909 --> 00:43:10.960 Cast to assign to player 807 00:43:10.960 --> 00:43:13.760 ANetTPSCharacter* 808 00:43:13.760 --> 00:43:19.199 and we need to pass pawn 809 00:43:19.199 --> 00:43:22.249 which owns this animation now 810 00:43:22.249 --> 00:43:27.320 Call TryGetPawnOwner 811 00:43:27.320 --> 00:43:29.600 To get this and 812 00:43:29.600 --> 00:43:32.150 Cast into ANetTPSCharacter 813 00:43:32.150 --> 00:43:33.800 and assign it here 814 00:43:33.800 --> 00:43:36.450 Since this is 815 00:43:36.450 --> 00:43:37.940 not included to this file 816 00:43:37.940 --> 00:43:39.650 If you compile then it occurs error 817 00:43:39.650 --> 00:43:42.300 Therefore add header file 818 00:43:42.300 --> 00:43:45.199 on the top like this 819 00:43:45.199 --> 00:43:49.940 Build it once more 820 00:43:49.940 --> 00:43:51.940 Now that build is succeeded 821 00:43:51.940 --> 00:43:56.240 In NativeUpdateAnimation, get current velocity 822 00:43:56.240 --> 00:43:59.800 of this player to character 823 00:43:59.800 --> 00:44:03.850 and assign Direction and Speed 824 00:44:03.850 --> 00:44:07.959 In NativeUpdateAnimation function 825 00:44:07.959 --> 00:44:09.509 It is possible only when player exist 826 00:44:09.509 --> 00:44:11.859 Let's say we got values but there is no player value 827 00:44:11.859 --> 00:44:14.879 Then it occurs null pointer error 828 00:44:14.879 --> 00:44:17.109 In order to process only when the player exist 829 00:44:17.109 --> 00:44:21.059 If player is not nullptr 830 00:44:21.059 --> 00:44:22.280 You can do like this 831 00:44:22.280 --> 00:44:24.130 To make it simple 832 00:44:24.130 --> 00:44:29.080 This let it process only when the player exist 833 00:44:29.080 --> 00:44:34.200 In here I will get Speed value 834 00:44:34.200 --> 00:44:39.280 and Direction value 835 00:44:39.280 --> 00:44:41.480 Value of Speed can be gotten like this 836 00:44:41.480 --> 00:44:43.330 speed = 837 00:44:43.330 --> 00:44:45.430 First, player's 838 00:44:45.430 --> 00:44:48.040 I should explain it more in theoretically 839 00:44:48.040 --> 00:44:52.700 Let's say player is standing like this 840 00:44:52.700 --> 00:44:56.350 The direction in which this character is 841 00:44:56.350 --> 00:44:57.650 Currently heading is 842 00:44:57.650 --> 00:44:59.159 is this way 843 00:44:59.159 --> 00:45:01.609 Character is moving towards this way 844 00:45:01.609 --> 00:45:05.959 Then when it's moving like this, this value 845 00:45:05.959 --> 00:45:10.109 will be speed, the direction 846 00:45:10.109 --> 00:45:14.119 Then direction of left and right is 847 00:45:14.119 --> 00:45:18.800 If this character is moving like this 848 00:45:18.800 --> 00:45:22.150 Then direction of left and right 849 00:45:22.150 --> 00:45:25.759 will be like this 850 00:45:25.759 --> 00:45:29.759 This and this direction for left and right 851 00:45:29.759 --> 00:45:32.460 When you consider this as criteria 852 00:45:32.460 --> 00:45:36.260 Then this velocity vector as criteria 853 00:45:36.260 --> 00:45:39.900 How to get this speed related to the front 854 00:45:39.900 --> 00:45:43.150 and direction related to left and right 855 00:45:43.150 --> 00:45:46.420 Then what we need is 856 00:45:46.420 --> 00:45:48.420 Inner product 857 00:45:48.420 --> 00:45:53.099 And how to get it 858 00:45:53.099 --> 00:45:55.349 Character is heading this way 859 00:45:55.349 --> 00:45:58.449 But where this character is facing now 860 00:45:58.449 --> 00:46:00.080 It's facing this way 861 00:46:00.080 --> 00:46:03.590 Then we want to press key to move toward this way 862 00:46:03.590 --> 00:46:07.690 Then character is facing this way 863 00:46:07.690 --> 00:46:09.679 and moving a bit diagonally 864 00:46:09.679 --> 00:46:12.929 Currently moving diagonally 865 00:46:12.929 --> 00:46:15.979 Then from here, left and right vector 866 00:46:15.979 --> 00:46:17.679 Direction vector, left and right vector 867 00:46:17.679 --> 00:46:19.629 We commonly call it right vector 868 00:46:19.629 --> 00:46:22.629 Then consider this character as criteria 869 00:46:22.629 --> 00:46:25.439 With this velocity vector 870 00:46:25.439 --> 00:46:29.339 We have to implement forward vector 871 00:46:29.339 --> 00:46:31.939 Use this vector 872 00:46:31.939 --> 00:46:34.879 And get forward and right vector 873 00:46:34.879 --> 00:46:37.779 This character is moving like this 874 00:46:37.779 --> 00:46:42.479 It’s moving like this on drawing 875 00:46:42.479 --> 00:46:44.469 This character is facing this way 876 00:46:44.469 --> 00:46:47.719 But moving towards that way 877 00:46:47.719 --> 00:46:51.300 When character is moving 878 00:46:51.300 --> 00:46:53.870 And facing this way, make this way as criterion 879 00:46:53.870 --> 00:46:56.670 Get forward and right vector 880 00:46:56.670 --> 00:47:00.159 Then how can we 881 00:47:00.159 --> 00:47:05.209 Use this velocity vector 882 00:47:05.209 --> 00:47:09.240 This is velocity vector 883 00:47:09.240 --> 00:47:10.790 Use this velocity vector 884 00:47:10.790 --> 00:47:13.490 To get forward and right vector 885 00:47:13.490 --> 00:47:16.159 This is how we should implement now 886 00:47:16.159 --> 00:47:18.609 So that we can get speed value 887 00:47:18.609 --> 00:47:20.709 And how fast it is when it move forward 888 00:47:20.709 --> 00:47:23.309 How fast it is when it move left and right 889 00:47:23.309 --> 00:47:25.340 How big it is 890 00:47:25.340 --> 00:47:30.280 We can get it using inner product very easily 891 00:47:30.280 --> 00:47:34.030 Velocity has value of x, y and z 892 00:47:34.030 --> 00:47:36.480 Let's say this V for velocity 893 00:47:36.480 --> 00:47:38.380 F for forward vector 894 00:47:38.380 --> 00:47:42.659 And this have value of x, y and z as well 895 00:47:42.679 --> 00:47:45.679 To get inner product, multiply coordinates with same index 896 00:47:45.679 --> 00:47:48.080 Multiply coordinates with same index 897 00:47:48.080 --> 00:47:51.780 When you get inner product, multiply coordinates 898 00:47:51.780 --> 00:47:53.080 With same index first 899 00:47:53.080 --> 00:47:58.080 Therefore we get it 900 00:47:58.080 --> 00:47:59.760 in VxFx VyFy form 901 00:47:59.760 --> 00:48:01.560 Forward vector this character facing 902 00:48:01.560 --> 00:48:06.819 Let's say forward only have one coordinate x 903 00:48:06.819 --> 00:48:11.879 Then we can get it 904 00:48:11.879 --> 00:48:15.820 Only with x coordinates like this 905 00:48:15.820 --> 00:48:23.170 Therefore we are going to get velocity and forward using inner product 906 00:48:23.170 --> 00:48:26.959 Or use inner product to get velocity and right 907 00:48:26.959 --> 00:48:28.459 and use these two to get direction like this 908 00:48:28.459 --> 00:48:32.609 Inner product from velocity and forward will be speed 909 00:48:32.609 --> 00:48:36.000 and inner product from velocity and right will be direction 910 00:48:36.000 --> 00:48:37.800 Let's process this part 911 00:48:37.800 --> 00:48:43.119 So write speed = FVector::DotProduct 912 00:48:43.119 --> 00:48:46.119 and first parameter we pass is vector 913 00:48:46.119 --> 00:48:51.679 So get velocity from player 914 00:48:51.679 --> 00:48:53.379 Then we get one vector 915 00:48:53.379 --> 00:48:56.429 And we need float speed which is scala value 916 00:48:56.429 --> 00:49:01.959 So dot product this and forward vector of player 917 00:49:01.959 --> 00:49:05.459 Dot product these two 918 00:49:05.459 --> 00:49:08.809 Then from this velocity vector 919 00:49:08.809 --> 00:49:12.000 And direction character is facing 920 00:49:12.000 --> 00:49:15.000 We can get size, velocity 921 00:49:15.000 --> 00:49:17.760 and same for the direction 922 00:49:17.760 --> 00:49:20.339 Press Ctrl D to duplicate 923 00:49:22.399 --> 00:49:25.899 For direction, velocity is same 924 00:49:25.899 --> 00:49:30.439 Get vector from player and get direction 925 00:49:30.439 --> 00:49:33.939 Then let me build it 926 00:49:33.939 --> 00:49:36.679 Go to Unreal Engine 927 00:49:36.679 --> 00:49:38.810 Character is currently like this 928 00:49:38.810 --> 00:49:41.639 And it's okay on animation as well 929 00:49:41.639 --> 00:49:44.339 Currently it doesn't have a pistol 930 00:49:44.339 --> 00:49:46.889 So even if we give direction and speed value 931 00:49:46.889 --> 00:49:49.399 It won't be played properly 932 00:49:49.399 --> 00:49:52.499 Animation existed is playing 933 00:49:52.499 --> 00:49:53.699 When it doesn't have a pistol 934 00:49:53.699 --> 00:49:54.839 To make animation processed 935 00:49:54.839 --> 00:49:56.800 When it has a pistol 936 00:49:56.800 --> 00:49:59.050 Go to Anim Preview Editor 937 00:49:59.050 --> 00:50:03.900 Check Has Pistol 938 00:50:03.900 --> 00:50:06.100 And on the bottom in yellow 939 00:50:06.100 --> 00:50:10.800 It says Changes made to preview only 940 00:50:10.800 --> 00:50:14.000 Click apply 941 00:50:14.000 --> 00:50:17.919 Then this will be remain checked while we proceed 942 00:50:17.919 --> 00:50:19.919 Click compile button 943 00:50:19.919 --> 00:50:21.569 Then this animation is 944 00:50:21.569 --> 00:50:24.439 Keep going to have a pistol 945 00:50:24.439 --> 00:50:26.839 Of course in here 946 00:50:26.839 --> 00:50:31.239 On C class, you can set default value to true 947 00:50:31.239 --> 00:50:33.399 To test this 948 00:50:33.399 --> 00:50:36.099 But simply in here 949 00:50:36.099 --> 00:50:38.649 Just check this and click apply 950 00:50:38.649 --> 00:50:41.239 to test this 951 00:50:41.239 --> 00:50:43.489 Now come to main editor and click play button 952 00:50:43.489 --> 00:50:47.800 Animation starts with a pistol 953 00:50:47.800 --> 00:50:51.630 Now let's move character It's moving 954 00:50:51.630 --> 00:50:54.840 You can see it moving backward, left and right 955 00:50:54.840 --> 00:50:59.080 But this animation moves as if it is teleporting 956 00:50:59.080 --> 00:51:00.080 Why is it like that 957 00:51:00.080 --> 00:51:03.180 In the value of motion of animation we brought 958 00:51:03.180 --> 00:51:06.480 It contains actual transform of animation 959 00:51:06.480 --> 00:51:09.719 It contains location, rotation and so 960 00:51:09.719 --> 00:51:13.520 So let's edit these animations little bit 961 00:51:13.520 --> 00:51:16.320 Those like MF_Pistol_Jog_Left 962 00:51:16.320 --> 00:51:18.430 Let's edit these 963 00:51:18.430 --> 00:51:22.120 On BS_PistolMove 964 00:51:22.120 --> 00:51:24.770 Open it and edit it 965 00:51:24.770 --> 00:51:26.750 Type mf_pistol 966 00:51:26.750 --> 00:51:30.360 To search what we use 967 00:51:30.919 --> 00:51:35.939 Double click Idle_Hipfire 968 00:51:35.959 --> 00:51:38.609 Double click this to open 969 00:51:38.609 --> 00:51:40.259 Then on Asset Details 970 00:51:40.259 --> 00:51:43.320 Search root on Asset Details on the left 971 00:51:43.320 --> 00:51:48.070 The reason it is modified is that there are transform values 972 00:51:48.070 --> 00:51:51.170 of animation are in the RootMotion 973 00:51:51.170 --> 00:51:52.959 Such as location and rotation 974 00:51:52.959 --> 00:51:56.159 Check Force Root Lock 975 00:51:56.159 --> 00:51:59.909 To lock Root forcibly 976 00:51:59.909 --> 00:52:03.639 So that they can't be applied 977 00:52:03.639 --> 00:52:05.289 Save it 978 00:52:05.289 --> 00:52:10.739 Check Fore Root Lock on Jog_Bwd as well 979 00:52:10.739 --> 00:52:12.520 Then it is running on the same spot 980 00:52:12.520 --> 00:52:13.570 Save it 981 00:52:13.570 --> 00:52:15.420 And same thing goes for the rest of them 982 00:52:15.420 --> 00:52:20.000 Check on Jog_Fwd and save it 983 00:52:20.000 --> 00:52:29.840 Check Left, save and check Right, save 984 00:52:30.719 --> 00:52:37.000 Check this on Bwd, Walk as well 985 00:52:43.760 --> 00:52:47.010 It's all done now Close this 986 00:52:47.010 --> 00:52:50.310 Go back and click play button and move 987 00:52:50.310 --> 00:52:55.239 Then you see it's moving properly now 988 00:52:57.279 --> 00:52:59.129 Move forward and backward 989 00:52:59.129 --> 00:53:01.379 You can see it is switched normally 990 00:53:01.379 --> 00:53:04.159 to animation with a pistol 991 00:53:04.159 --> 00:53:10.520 That's it for processing movement of player 992 00:53:10.520 --> 00:53:13.770 Added external animation assets we used 993 00:53:13.770 --> 00:53:15.520 Created movement animation assets 994 00:53:15.520 --> 00:53:18.020 And created C class 995 00:53:18.020 --> 00:53:22.879 Edited animation blueprint in general 996 00:53:22.879 --> 00:53:25.820 Let's put together what we learned in this chapter 997 00:53:26.978 --> 00:53:30.478 Add external assets and create movement animation assets Add external assets on the project and assign skeletal information you want to use 998 00:53:30.478 --> 00:53:33.978 Add animation to change motions depends on the values of Direction and Space by creating Blend Space 999 00:53:33.978 --> 00:53:35.728 Create C class and edit animation blueprint Create NetPlayerAnimInstance C class to control animation and implement animation blueprint control logic of player 1000 00:53:35.728 --> 00:53:37.478 Branch process when there is a pistol and not by using Conduit node on animation blueprint 1001 00:53:37.478 --> 00:53:39.228 Create transition which is able to be executed in any state through State Alias node 1002 00:53:39.228 --> 00:53:40.978 Use inner product of vector to get forward and right direction and get speed with forward and right and apply to Direction and Speed on Blend Space