WEBVTT 1 00:00:23.799 --> 00:00:26.139 Hello, this is Younghoon Lee 2 00:00:26.139 --> 00:00:30.559 In this lecture, we'll apply player animation 3 00:00:30.559 --> 00:00:36.639 In this lesson, you will learn how to control the player's animation 4 00:00:36.639 --> 00:00:40.240 You will learn how to download animations from the marketplace 5 00:00:40.240 --> 00:00:44.320 Retarget them, and apply Animation Blueprints 6 00:00:44.320 --> 00:00:49.439 To build an animation state machine 7 00:00:49.439 --> 00:00:52.279 We'll also learn how to use Blend Space 8 00:00:52.279 --> 00:00:59.200 To smooth out player movement animations 9 00:00:59.200 --> 00:01:01.880 This time, we'll try animation 10 00:01:01.880 --> 00:01:05.440 To animate the main character 11 00:01:05.440 --> 00:01:07.839 Please open Unreal Launcher 12 00:01:07.839 --> 00:01:14.879 When you look here, there's a Marketplace at Unreal Engine 13 00:01:14.879 --> 00:01:20.279 In the Marketplace 14 00:01:20.279 --> 00:01:24.680 There is an Animation Starter Pack 15 00:01:24.680 --> 00:01:26.320 If you do searching 16 00:01:26.320 --> 00:01:28.879 You will find this 17 00:01:28.879 --> 00:01:33.040 I will add this to the project by clicking 18 00:01:33.040 --> 00:01:36.000 Select 'Show all projects' 19 00:01:36.000 --> 00:01:40.000 Now, our project is cpp_tps 20 00:01:40.000 --> 00:01:43.080 But version 5.3 is not supported 21 00:01:43.080 --> 00:01:48.480 So, I will change it to version 5.2 and then add this 22 00:01:51.279 --> 00:01:57.760 The capacity is not that big, so it is downloaded quickly 23 00:01:57.760 --> 00:01:59.959 When you see the project 24 00:01:59.959 --> 00:02:05.320 You can find out that the Animation Starter Pack folder has been is added 25 00:02:05.320 --> 00:02:13.639 But this is an animation based on an asset used in Unreal Engine 4 26 00:02:13.639 --> 00:02:18.479 So, we have to change this for Unreal Engine 5 27 00:02:18.479 --> 00:02:21.039 I'll do that work 28 00:02:21.039 --> 00:02:25.080 First, I'm going to make a folder to add the animation 29 00:02:25.080 --> 00:02:27.800 Under the content 30 00:02:27.800 --> 00:02:30.479 At New Folder 31 00:02:30.479 --> 00:02:36.199 I'll make a folder named animations 32 00:02:36.199 --> 00:02:37.919 I'm not going to use this as is 33 00:02:37.919 --> 00:02:44.839 I'm going to transform it this way and then delete 34 00:02:44.839 --> 00:02:48.360 If you take a look, you can do filtering 35 00:02:48.360 --> 00:02:53.360 Here, from the Animation section 36 00:02:53.360 --> 00:02:56.199 There's an Animation Sequence 37 00:02:56.199 --> 00:02:57.279 Here it is 38 00:02:57.279 --> 00:03:01.880 If you click on it, only the Animation Sequences will appear 39 00:03:01.880 --> 00:03:09.440 In Unreal, one animated movement is called an Animation Sequence 40 00:03:09.440 --> 00:03:13.399 So, the Animation Sequence refers to this one action 41 00:03:13.399 --> 00:03:16.679 Like this 42 00:03:16.679 --> 00:03:21.199 Press ctrl + a to select all 43 00:03:21.199 --> 00:03:24.320 Then right-click here 44 00:03:24.320 --> 00:03:29.600 There's something called Retarget Animation Asset 45 00:03:29.600 --> 00:03:31.839 If you select this, there is also a duplicate 46 00:03:31.839 --> 00:03:34.960 Please click this 47 00:03:34.960 --> 00:03:37.880 Now, this menu will appear 48 00:03:37.880 --> 00:03:43.919 I will click on the IK Retargeter here at the top left 49 00:03:43.919 --> 00:03:47.279 Because I will change 4 to 5 50 00:03:47.279 --> 00:03:50.800 I will select the second menu 51 00:03:50.800 --> 00:03:52.039 Now it comes out like this 52 00:03:52.039 --> 00:03:56.399 You can do it as is, but since I'm using a Quinn 53 00:03:56.399 --> 00:03:59.520 I'll change it to Quinn form and proceed 54 00:03:59.520 --> 00:04:00.880 After doing this 55 00:04:00.880 --> 00:04:02.919 You can then select the folder 56 00:04:02.919 --> 00:04:08.520 Press Change to make it look like this in the Animation folder 57 00:04:08.520 --> 00:04:31.000 And press the Retarget button 58 00:04:31.000 --> 00:04:33.760 Then, all of them have been retargeted 59 00:04:33.760 --> 00:04:37.920 So let's save them 60 00:04:37.920 --> 00:04:40.359 And open one to check 61 00:04:40.359 --> 00:04:43.679 If you do this, you can see that the Quinn character 62 00:04:43.679 --> 00:04:47.720 In Unreal 5 is animated like this 63 00:04:47.720 --> 00:04:50.959 The animation startup pack has overlapping names 64 00:04:50.959 --> 00:04:52.079 Which can be confusing 65 00:04:52.079 --> 00:04:54.440 So I'll delete this 66 00:04:54.440 --> 00:05:06.799 Press the Delete key to Force Delete 67 00:05:06.799 --> 00:05:11.279 Now that we have the animation we want to use 68 00:05:11.279 --> 00:05:15.519 Let's use it to process the animation movemen 69 00:05:15.519 --> 00:05:17.160 Go to the Blueprint folder 70 00:05:17.160 --> 00:05:21.920 And open the Protagonist Blueprint clas 71 00:05:21.920 --> 00:05:25.079 As you can see, the animation is 72 00:05:25.079 --> 00:05:31.600 Ultimately done by the Mesh that represents this Mesh body 73 00:05:31.600 --> 00:05:37.200 If you look at the details after selecting Mesh 74 00:05:37.200 --> 00:05:39.480 You will see something called animation 75 00:05:39.480 --> 00:05:42.320 The animation mode is in the animation category 76 00:05:42.320 --> 00:05:44.119 And the class is like this 77 00:05:44.119 --> 00:05:46.480 If you look at it, it is a blueprint 78 00:05:46.480 --> 00:05:51.679 But if you use the S set, you can reflect the animation immediately 79 00:05:51.679 --> 00:06:02.799 For example, he will be in an idle posture 80 00:06:02.799 --> 00:06:09.959 So if you select this, he will be in a posture holding a gun like this 81 00:06:09.959 --> 00:06:11.720 You can control it like this 82 00:06:11.720 --> 00:06:14.799 You could produce it by replacing all animations 83 00:06:14.799 --> 00:06:17.799 One by one with ones that fit the situation 84 00:06:17.799 --> 00:06:20.760 But this wouldn't be very efficient 85 00:06:20.760 --> 00:06:27.040 So, rather than this, we will try to control it using the blueprint method 86 00:06:27.040 --> 00:06:33.519 Let's create an animation blueprint and place it here 87 00:06:33.519 --> 00:06:36.880 Since it is a blueprint, I will create it in this folder 88 00:06:36.880 --> 00:06:41.320 If you right-click, there is an animation 89 00:06:41.320 --> 00:06:43.720 In animation, there is something called an animation blueprint 90 00:06:43.720 --> 00:06:45.839 I'll click on this to create it 91 00:06:45.839 --> 00:06:49.559 Then, we will know what to make of the skeleton 92 00:06:49.559 --> 00:06:53.880 If you look here, there is a third SK mannequin 93 00:06:53.880 --> 00:06:58.760 The bone of the character we use now 94 00:06:58.760 --> 00:06:59.920 It's a skeleton 95 00:06:59.920 --> 00:07:02.320 I'll choose thi 96 00:07:02.320 --> 00:07:04.959 And create 97 00:07:04.959 --> 00:07:10.519 The name is Animation Blueprint, so I'll call it AB_ 98 00:07:10.519 --> 00:07:14.200 Since this is a TPSPlayer 99 00:07:14.200 --> 00:07:18.920 I will write it with the same name 100 00:07:18.920 --> 00:07:22.519 Since it is an animation blueprint, should we call it ABP? 101 00:07:22.519 --> 00:07:25.000 Now, ABP_ let's do it like this 102 00:07:25.000 --> 00:07:29.920 Then double-click on this, and it looks like this 103 00:07:29.920 --> 00:07:32.799 If you look at these structures 104 00:07:32.799 --> 00:07:35.720 There is My Blueprint on the left 105 00:07:35.720 --> 00:07:37.760 And here is a place called Event Graph 106 00:07:37.760 --> 00:07:39.760 If you double-click here 107 00:07:39.760 --> 00:07:44.160 Yu will see a space where you can do the visual scripting we have been seeing 108 00:07:44.200 --> 00:07:51.119 AnimGraph can be thought of as a space where animation sequences are placed 109 00:07:51.119 --> 00:07:55.160 If you go here and look at the animation on the right 110 00:07:55.160 --> 00:08:00.519 You will see an asset browser, if you look here, you will see a list of things you can enter here 111 00:08:00.519 --> 00:08:05.079 Here, I will first introduce the idle posture 112 00:08:05.079 --> 00:08:11.279 e will use Idle, Rifle, and Iron Sight as the default actions 113 00:08:11.279 --> 00:08:13.079 Just connect like this 114 00:08:13.079 --> 00:08:14.480 You can see the compile here 115 00:08:14.480 --> 00:08:19.440 Click this or the one at the top to compile 116 00:08:19.440 --> 00:08:21.359 I guess I made a mistake 117 00:08:21.359 --> 00:08:25.839 With this 118 00:08:25.839 --> 00:08:29.640 When you compile like this, you will end up with this posture 119 00:08:29.640 --> 00:08:32.599 Save it 120 00:08:32.599 --> 00:08:38.080 Next, we will assign this animation blueprint to the main character 121 00:08:38.080 --> 00:08:45.200 If you click here and select ABP_TPSPlayer to reflect it 122 00:08:45.200 --> 00:08:50.960 You can see the basic operation like this 123 00:08:50.960 --> 00:08:53.200 It is structured very simply 124 00:08:53.200 --> 00:08:59.159 Let's continue the animation using this 125 00:08:59.159 --> 00:09:04.719 Let's go back to the Animation Blueprint 126 00:09:04.719 --> 00:09:10.280 This reflects only one animation 127 00:09:10.280 --> 00:09:14.640 But instead of doing this, we will try to control it using a state machine 128 00:09:14.640 --> 00:09:17.440 If you right-click here 129 00:09:17.440 --> 00:09:18.719 This menu will appear 130 00:09:18.719 --> 00:09:23.359 If you say state machine here, it will look like this 131 00:09:23.359 --> 00:09:26.440 I'll click on this and make it like this 132 00:09:26.440 --> 00:09:30.080 This is a state, should we call it FSM? 133 00:09:30.080 --> 00:09:35.880 Since we will move this, let's name it moveFSM 134 00:09:35.880 --> 00:09:38.760 And delete it 135 00:09:38.760 --> 00:09:44.719 Since the results appear here, I will link them like this 136 00:09:44.719 --> 00:09:49.400 Since there's nothing right now, I'll just do an A pose like this 137 00:09:49.400 --> 00:09:55.359 I'll double-click and go in here, and I'll take out the basic pose from earlier 138 00:09:55.359 --> 00:09:58.119 And connect it like this 139 00:09:58.119 --> 00:10:00.359 When connecting, instead of putting it in the center here 140 00:10:00.359 --> 00:10:05.760 You can connect it by hovering your mouse over the white border outside here 141 00:10:05.760 --> 00:10:09.359 We learned about state machines 142 00:10:09.359 --> 00:10:14.400 A 143 00:10:14.400 --> 00:10:16.239 This is the content 144 00:10:16.239 --> 00:10:19.000 You can think of this as a state 145 00:10:19.000 --> 00:10:21.320 Which means transition 146 00:10:21.320 --> 00:10:23.799 Entry means starting now 147 00:10:23.799 --> 00:10:29.719 And once it starts, it transitions to this direction and does this animation 148 00:10:29.719 --> 00:10:32.599 Then it will work like this 149 00:10:32.599 --> 00:10:36.919 To control this 150 00:10:36.919 --> 00:10:39.880 Let's add more animation 151 00:10:39.880 --> 00:10:45.320 If you look here, you will see a walking motion, let's call it walk 152 00:10:45.320 --> 00:10:49.280 Then there are four walks like this 153 00:10:49.280 --> 00:10:55.599 Iron Sight has four walking movements: forward, backward, left, and right 154 00:10:55.599 --> 00:10:58.239 We will use these to process them 155 00:10:58.239 --> 00:11:00.719 Shall we just try the front and back first? 156 00:11:00.719 --> 00:11:05.000 I will put two things: Forward and Backward 157 00:11:12.840 --> 00:11:16.159 For now, shall we just try moving forward first? 158 00:11:16.159 --> 00:11:19.239 If you hover your mouse over it like this, it will turn white 159 00:11:19.239 --> 00:11:22.719 Then, in this state, if you press the left mouse button and pull it like this 160 00:11:22.719 --> 00:11:25.080 An arrow that allows you to transition will appear 161 00:11:25.080 --> 00:11:26.840 You should be able to send it this way 162 00:11:26.840 --> 00:11:29.640 And return it even if you turn in the opposite direction 163 00:11:29.640 --> 00:11:34.919 I'll handle it like this 164 00:11:34.919 --> 00:11:40.159 We need to create conditions to handle this 165 00:11:40.159 --> 00:11:42.799 The thing that looks round over there is the condition 166 00:11:42.799 --> 00:11:46.039 If this condition is met, it will transfer in this direction 167 00:11:46.039 --> 00:11:48.440 Let me try it like this 168 00:11:48.440 --> 00:11:51.840 If you look here, you can create a variable 169 00:11:51.840 --> 00:11:53.239 Let's create a variable 170 00:11:53.239 --> 00:11:59.719 In this way, we will create a variable called speed 171 00:11:59.719 --> 00:12:04.919 And it will be of type Float, not Bool 172 00:12:04.919 --> 00:12:09.359 So, how are we going to do this? We're going to do it with this concept 173 00:12:09.359 --> 00:12:15.520 If we manipulate the Player and press the W key or something like that, it moves forward 174 00:12:15.520 --> 00:12:22.039 If you look at it from the side, when the Player is like this, if you press the W key, it will move forward like this 175 00:12:22.039 --> 00:12:27.359 So, let's take a quick look at Player 176 00:12:27.359 --> 00:12:28.880 To see how fast this guy goes 177 00:12:28.880 --> 00:12:35.440 If you look at Character Movement here, there is information about walking 178 00:12:35.440 --> 00:12:37.520 Here's the magnitude of the movement 179 00:12:37.520 --> 00:12:39.599 There is a value called work speed 180 00:12:39.599 --> 00:12:43.159 Which moves at 6m per second 181 00:12:43.159 --> 00:12:47.559 If we talk about it based on that 182 00:12:47.559 --> 00:12:51.880 Velocity is created, and when you press the w key, velocity is created 183 00:12:51.880 --> 00:12:54.599 And there is velocity 184 00:12:54.599 --> 00:12:57.960 The direction of which is forward 185 00:12:57.960 --> 00:13:03.520 And then the speed becomes the work speed and becomes 600 186 00:13:03.520 --> 00:13:06.239 This is the structure 187 00:13:06.239 --> 00:13:11.880 Speed ​​means the direction is removed, and only the speed value is returned 188 00:13:11.880 --> 00:13:18.000 And speed means it only brings size to the front 189 00:13:18.000 --> 00:13:22.440 Let's name it this 190 00:13:22.440 --> 00:13:28.599 If we come back and look at the speed conditions, the speed will be 0 when standing still 191 00:13:28.599 --> 00:13:33.280 And being able to walk means that your speed is greater than 0 192 00:13:33.280 --> 00:13:39.799 However, since it is a floating point operation, we will use the Float type now 193 00:13:39.799 --> 00:13:45.280 As for the Float type, floating point operations have some errors 194 00:13:45.280 --> 00:13:46.280 For example, something like this 195 00:13:46.280 --> 00:13:50.640 Even if we specify it as 1, if we calculate it internally 196 00:13:50.640 --> 00:13:54.559 It may end up as 0.99999 197 00:13:54.559 --> 00:13:58.159 This can be said, it is the same as 1 198 00:13:58.159 --> 00:14:05.400 The Float type has this error 199 00:14:05.400 --> 00:14:14.919 If you're curious about this, try searching for floating point operations 200 00:14:14.919 --> 00:14:18.960 Just take a look at the error 201 00:14:18.960 --> 00:14:21.719 That's why we'll do it this way 202 00:14:21.719 --> 00:14:27.400 Rather than saying that this speed value is greater than 0 203 00:14:27.400 --> 00:14:32.280 We will create a section of about 0.1, looking at it this way 204 00:14:32.280 --> 00:14:35.840 If this is 0 and this is 1 205 00:14:35.840 --> 00:14:39.359 This will actually be +600 206 00:14:39.359 --> 00:14:40.840 Because the speed is 600 207 00:14:40.840 --> 00:14:44.719 Then, if I'm standing still, it gives me a section around here 208 00:14:44.719 --> 00:14:46.760 Rather than 0 209 00:14:46.760 --> 00:14:49.440 I want to give it 0.1 210 00:14:49.440 --> 00:14:55.200 But if it is less than 0.1 or greater than -0.1, it is just standing 211 00:14:55.200 --> 00:14:57.599 I want to set it like this 212 00:14:57.599 --> 00:15:01.080 Then, since this error is calculated slightly here 213 00:15:01.479 --> 00:15:03.679 We can ignore it and proceed 214 00:15:03.679 --> 00:15:07.919 So, I'm going to give a condition here 215 00:15:07.919 --> 00:15:10.599 And if you double-click on it, you can enter it like this 216 00:15:10.599 --> 00:15:13.760 Let's take out the speed here 217 00:15:13.760 --> 00:15:16.960 Specify that 218 00:15:16.960 --> 00:15:21.559 If it is greater than 0.1 219 00:15:21.559 --> 00:15:26.400 It means walking forward 220 00:15:26.400 --> 00:15:27.520 Compile 221 00:15:27.520 --> 00:15:31.080 Come back, and click here to come back 222 00:15:31.080 --> 00:15:33.679 What returns are when you double-click 223 00:15:33.679 --> 00:15:36.559 When the speed is less than 0.1 224 00:15:36.559 --> 00:15:40.080 I want to understand that it means stop 225 00:15:40.080 --> 00:15:49.919 Let's call it less and call it 0.1 226 00:15:49.919 --> 00:15:52.479 You can specify it like this, right? 227 00:15:52.479 --> 00:15:56.080 Next, we need to actually add the speed 228 00:15:56.080 --> 00:15:58.359 And here's a preview 229 00:15:58.359 --> 00:16:01.280 You can use this to test it 230 00:16:01.280 --> 00:16:02.760 The speed is listed here, right? 231 00:16:02.760 --> 00:16:06.200 If you write 600 here, it will walk forward 232 00:16:06.200 --> 00:16:09.119 If you write 0 again, it will stand still 233 00:16:09.119 --> 00:16:14.640 However, looking at the animation, it seems like the idle posture is repeated 234 00:16:14.640 --> 00:16:19.640 But when I write down 600, walk and stop 235 00:16:19.640 --> 00:16:22.239 I think this is because it is not repeated 236 00:16:22.239 --> 00:16:25.640 So, let me take care of that 237 00:16:25.640 --> 00:16:29.719 If you double-click this 238 00:16:29.719 --> 00:16:38.679 And look at this animation, if you look at Details, there is a Loop Animation at the bottom 239 00:16:38.679 --> 00:16:41.119 Let me check this 240 00:16:41.119 --> 00:16:43.239 I will just do Idle as well 241 00:16:43.239 --> 00:16:45.919 Do this and then walk forward, right? 242 00:16:45.919 --> 00:16:53.840 After selecting this, we will check Loop Animation 243 00:16:53.840 --> 00:16:57.760 If you enter a value of 600, it will continue walking 244 00:16:57.760 --> 00:17:01.080 You can set it up like this repeatedly 245 00:17:01.080 --> 00:17:02.479 And let's try it on the other side 246 00:17:02.479 --> 00:17:05.760 Please make arrows here as well 247 00:17:05.760 --> 00:17:11.319 Next, the condition to stay still and walk backward will be 248 00:17:11.319 --> 00:17:17.319 When the speed becomes less than -0.1 249 00:17:17.319 --> 00:17:20.640 So I'm going to go with small, negative 250 00:17:20.640 --> 00:17:28.839 If it is less than -0.1, you can understand it as walking backward 251 00:17:28.839 --> 00:17:35.680 When it comes back, you can understand it as having become bigger than -0.1 252 00:17:35.680 --> 00:17:39.079 This is how the speed increased 253 00:17:39.079 --> 00:17:45.680 It will now stand in place if it becomes greater than Greater -0.1 254 00:17:45.680 --> 00:17:48.280 I'll configure it like this 255 00:17:48.280 --> 00:17:52.680 Then, when I say 0, the speed stops 256 00:17:52.680 --> 00:17:58.359 When I say 1, it walks forward, and when I say -1, it walks backward like that 257 00:17:58.359 --> 00:18:02.280 You can control it like this, and you will also need to modify the animation for this 258 00:18:02.280 --> 00:18:06.040 Like this 259 00:18:06.040 --> 00:18:07.959 Oh, my mistake 260 00:18:07.959 --> 00:18:13.760 I'll select this and check this Loop 261 00:18:13.760 --> 00:18:16.400 Preview is literally, preview 262 00:18:16.400 --> 00:18:21.640 Modifying this value does not mean that the speed value here will become this value 263 00:18:21.640 --> 00:18:25.920 We need to process this speed value now 264 00:18:25.920 --> 00:18:30.439 But let's try controlling it in the blueprint first 265 00:18:30.439 --> 00:18:34.319 If you look at the event graph here, it looks like this 266 00:18:34.319 --> 00:18:36.839 If you look here, you will see that the name Owner is used 267 00:18:36.839 --> 00:18:42.479 Owner means it owns this component 268 00:18:42.479 --> 00:18:46.079 Also, this is not component, it's Animation 269 00:18:46.079 --> 00:18:48.880 It is called Anim Instance 270 00:18:48.880 --> 00:18:52.760 The Parent Class is said as Anim Instance 271 00:18:52.760 --> 00:18:57.880 So, at last, Mesh has the Anim Instance 272 00:18:57.880 --> 00:19:00.880 The Mesh Component has it 273 00:19:00.880 --> 00:19:07.119 This has a Mesh Component, and it is the concept this character has 274 00:19:07.119 --> 00:19:10.599 When you see here, it is said, Pawn Owner 275 00:19:10.599 --> 00:19:15.359 I'm not talking about the Mesh Component that owns this 276 00:19:15.359 --> 00:19:21.959 But the Pawn that owns the Mesh that owns this animation 277 00:19:21.959 --> 00:19:25.680 After importing it 278 00:19:25.680 --> 00:19:28.880 I will verify it 279 00:19:28.880 --> 00:19:30.760 Because it may not exist 280 00:19:30.760 --> 00:19:34.000 Because, to process this in Unreal Engine 281 00:19:34.000 --> 00:19:38.359 This is also created and configured on this editor 282 00:19:38.359 --> 00:19:40.599 As a result, an error may occur here 283 00:19:40.599 --> 00:19:46.119 So, I will check this with IsValid 284 00:19:46.119 --> 00:19:47.599 You can do this 285 00:19:47.599 --> 00:19:50.400 You can think of this in the same way as Null Check 286 00:19:50.400 --> 00:19:59.199 To be precise, it is a concept that checks sleep more powerfully than the null check 287 00:19:59.199 --> 00:20:01.280 But you can do it with this 288 00:20:01.280 --> 00:20:03.319 If you check it like this 289 00:20:03.319 --> 00:20:08.599 And it is valid, you can use it 290 00:20:08.599 --> 00:20:11.239 This can get velocity from the Pawn owner 291 00:20:11.239 --> 00:20:15.319 Get Velocity, like this 292 00:20:15.319 --> 00:20:19.000 So, let's put the value here into the speed like this 293 00:20:19.000 --> 00:20:20.560 I will set this 294 00:20:20.560 --> 00:20:28.560 If you get the vector length 295 00:20:28.560 --> 00:20:32.640 Called length here, you can get the size of this vector 296 00:20:32.640 --> 00:20:35.280 Let's put this in speed first 297 00:20:35.280 --> 00:20:39.920 Do this and compile 298 00:20:39.920 --> 00:20:43.079 Then, let's run it here and get it moving 299 00:20:43.079 --> 00:20:44.520 Then it walks 300 00:20:44.520 --> 00:20:49.920 Even if you go backward, it looks like you are walking 301 00:20:49.920 --> 00:20:59.920 Like this 302 00:20:59.920 --> 00:21:05.560 I just brought up the speed like this 303 00:21:05.560 --> 00:21:08.040 But I didn't do it accurately 304 00:21:08.040 --> 00:21:13.239 Because bringing about speed means bringing about the speed of velocity 305 00:21:13.239 --> 00:21:18.000 This is what it feels like when you see it from the air 306 00:21:18.000 --> 00:21:19.920 We can move in the direction of our arms 307 00:21:19.920 --> 00:21:26.640 If you press the WASD key and if this is the front 308 00:21:26.640 --> 00:21:29.839 If it goes like this, you only pressed W 309 00:21:29.839 --> 00:21:33.439 If it goes like this, you only pressed D 310 00:21:33.439 --> 00:21:38.520 So if it goes like this, it's like pressing W and D at the same time 311 00:21:38.520 --> 00:21:41.280 If you press them simultaneously like this 312 00:21:41.280 --> 00:21:45.199 What is the speed? 313 00:21:45.199 --> 00:21:46.880 It might say 600 314 00:21:46.880 --> 00:21:51.280 But it can be a little ambiguous 315 00:21:51.280 --> 00:21:55.640 So, I want the speed value for exactly the front 316 00:21:55.640 --> 00:22:03.000 And then some value going to the side separately 317 00:22:03.000 --> 00:22:05.359 I mean 318 00:22:05.359 --> 00:22:06.199 Look 319 00:22:06.199 --> 00:22:11.640 When I run it here, it does a walking animation even if I move to the right 320 00:22:11.640 --> 00:22:13.760 Even if you move to the left 321 00:22:13.760 --> 00:22:16.800 When going forward, backward, right, left 322 00:22:16.800 --> 00:22:20.839 It happens like this because they have velocity values 323 00:22:20.839 --> 00:22:24.000 Of course, it only moves from front to back 324 00:22:24.000 --> 00:22:26.119 So there is no big problem if you do this 325 00:22:26.119 --> 00:22:30.520 However, the final form we will do now 326 00:22:30.520 --> 00:22:33.079 Will include left and right movement animation 327 00:22:33.079 --> 00:22:40.280 Then, we need to know the speed values ​​not only forward and backward but also left and right 328 00:22:40.280 --> 00:22:43.640 So, I'm going to separate this a little bit 329 00:22:43.640 --> 00:22:47.000 So, let's create one more variable here 330 00:22:47.000 --> 00:22:50.479 Called a direction 331 00:22:50.479 --> 00:22:53.439 Now, we are going to create two-speed directions like this 332 00:22:53.439 --> 00:22:58.760 The meaning of this is that this is a variable that contains the size of the movement back and forth 333 00:22:58.760 --> 00:23:01.560 And this is a variable that contains the size of the movement left and right 334 00:23:01.560 --> 00:23:06.000 You can understand it like this 335 00:23:06.000 --> 00:23:11.319 So, how do we get that ingredient out of Velocity? 336 00:23:11.319 --> 00:23:13.560 I'm going to learn about that in a bit 337 00:23:13.560 --> 00:23:18.359 Now, we can do that using vector multiply 338 00:23:18.359 --> 00:23:22.319 We can process it using the inner product 339 00:23:22.319 --> 00:23:28.439 It means that we will use a product in a vector 340 00:23:28.439 --> 00:23:32.520 In a broad sense, the product has an outer product and an inner product 341 00:23:32.520 --> 00:23:34.439 This time, we are going to do inner product 342 00:23:34.439 --> 00:23:39.760 The inner product is a dot, and is expressed as a dot like this 343 00:23:39.760 --> 00:23:46.040 Dot Product 344 00:23:46.040 --> 00:23:48.239 This is Dot Product 345 00:23:48.239 --> 00:23:51.040 Then we're going to do a dot 346 00:23:51.040 --> 00:23:54.199 Let's say there's a vector like this 347 00:23:54.199 --> 00:23:56.239 And two like this 348 00:23:56.239 --> 00:24:00.760 Vector dots are written like this 349 00:24:00.760 --> 00:24:03.839 In this way, we write the vector like this 350 00:24:03.839 --> 00:24:08.839 If we express this again, it is a vector, so there will be a, b, and c 351 00:24:08.839 --> 00:24:10.400 There will be x,y,z 352 00:24:10.400 --> 00:24:15.439 Then we have x in a times b by x 353 00:24:15.439 --> 00:24:20.920 Then multiply a by y and b by y 354 00:24:20.920 --> 00:24:27.520 Then add again and multiply a by z and b by z 355 00:24:27.520 --> 00:24:30.280 So, this is actually a float value 356 00:24:30.280 --> 00:24:34.920 So, as a result, this value is a float value 357 00:24:34.920 --> 00:24:38.280 This is now the Dot Project 358 00:24:38.280 --> 00:24:40.560 And the concept of doing this is like this 359 00:24:40.560 --> 00:24:44.040 Let's say this is a and this is b 360 00:24:44.040 --> 00:24:46.599 Then, it's a little crooked right now 361 00:24:46.599 --> 00:24:50.800 But if I just call it b, it's 0,0,1 362 00:24:50.800 --> 00:24:53.800 This is also 0,0,1 363 00:24:53.800 --> 00:24:56.239 In this order: x,y,z 364 00:24:56.239 --> 00:25:01.920 Then, if you substitute here, it becomes 0,0,0,0,1 365 00:25:01.920 --> 00:25:05.719 So what is the result of this? 366 00:25:05.719 --> 00:25:10.439 If you multiply it like this, of course, it is 1 367 00:25:10.439 --> 00:25:16.119 So, vectors in the same direction result in 1 368 00:25:16.119 --> 00:25:17.839 So, let's look at the vector that looks like this 369 00:25:17.839 --> 00:25:21.239 Let's dot a vector that looks like this and a vector that looks like this 370 00:25:21.239 --> 00:25:24.199 If this is a and b 371 00:25:24.199 --> 00:25:29.040 Then 0,0,1 372 00:25:29.040 --> 00:25:33.319 And then this is 0,1,0 373 00:25:33.319 --> 00:25:35.239 Because y is 1, right? 374 00:25:35.239 --> 00:25:44.239 Then it will be 0 times 1 times 0 375 00:25:44.239 --> 00:25:45.119 So how much is this 376 00:25:45.119 --> 00:25:48.560 It's 0 plus 0 plus 0 377 00:25:48.560 --> 00:25:49.920 So it is 0 378 00:25:49.920 --> 00:25:52.760 So, something vertical like this is a right angle like this 379 00:25:52.760 --> 00:25:57.160 If you dot two perpendicular vectors, they are 0 380 00:25:57.160 --> 00:26:00.640 I'm talking about 0 and 1 because when the length is 1, like this 381 00:26:00.640 --> 00:26:03.280 When the length of the vector is 1 382 00:26:03.280 --> 00:26:04.640 There's one last thing, right? 383 00:26:04.640 --> 00:26:09.920 The opposite side is like this: the opposite side of 180 degrees 384 00:26:09.920 --> 00:26:14.680 The opposite side, 0,0,-1 385 00:26:14.680 --> 00:26:16.880 This one is 0,0,1 386 00:26:16.880 --> 00:26:21.520 Then, if you substitute here, it is 0,0,1 387 00:26:21.520 --> 00:26:24.160 Which is 0,0,-1 388 00:26:24.160 --> 00:26:26.839 Multiply this 389 00:26:26.839 --> 00:26:27.839 Add it all up 390 00:26:27.839 --> 00:26:31.599 Then this is 0, 0, and this is minus 1 391 00:26:31.599 --> 00:26:33.359 So it's minus one 392 00:26:33.359 --> 00:26:35.319 Here, if it's in the same direction, 1 comes out 393 00:26:35.319 --> 00:26:38.520 When you do a dot, if it's perpendicular, 0 comes out 394 00:26:38.520 --> 00:26:42.160 And if it's in the opposite direction, minus 1 comes out 395 00:26:42.160 --> 00:26:43.479 What dot is 396 00:26:43.479 --> 00:26:47.520 With this, I usually just find the angle 397 00:26:47.520 --> 00:26:49.280 I can prove this 398 00:26:49.280 --> 00:26:54.920 Or express the inner product like this 399 00:26:54.920 --> 00:27:00.119 When you say a.b 400 00:27:00.119 --> 00:27:06.800 If you write it like this in a, it means that the length of this vector called a is a scalar 401 00:27:06.800 --> 00:27:11.199 Multiply b by the scalar 402 00:27:11.199 --> 00:27:14.040 Multiplication is usually cosine 403 00:27:14.040 --> 00:27:19.439 We don't express multiplication, but we express it here as cosine theta 404 00:27:19.439 --> 00:27:22.640 Then, if the length is 1, this is 1 times 1 405 00:27:22.640 --> 00:27:25.599 So this disappears, and only the cosine setter remains 406 00:27:25.599 --> 00:27:28.680 If you were to prove this by drawing 407 00:27:28.680 --> 00:27:32.359 A picture of the cosine setter, it would look like this 408 00:27:32.359 --> 00:27:35.400 This is what cosine looks like 409 00:27:35.400 --> 00:27:38.319 If you search on Google for something like this, you will find it 410 00:27:38.319 --> 00:27:41.760 If this is 0, minus 1, and 1 411 00:27:41.760 --> 00:27:44.119 Then it comes out like this 412 00:27:44.119 --> 00:27:46.599 Then it goes up like this 413 00:27:46.599 --> 00:27:48.880 And then like this 414 00:27:48.880 --> 00:27:51.439 It has a wave shape 415 00:27:51.439 --> 00:27:53.280 And the other side is like this 416 00:27:53.280 --> 00:27:56.400 So how much is this? 417 00:27:56.400 --> 00:28:00.640 This is now 418 00:28:00.640 --> 00:28:02.599 2 out of pie 419 00:28:02.599 --> 00:28:05.800 And if it goes like this, here's where minus 1 reaches 420 00:28:05.800 --> 00:28:08.359 This is pi 421 00:28:08.359 --> 00:28:11.400 Usually, this is pi we know now 422 00:28:11.400 --> 00:28:13.239 It comes up a lot when talking about radians 423 00:28:13.239 --> 00:28:18.760 But when expressing a circle, when we find the angle or circumference of the circle 424 00:28:18.760 --> 00:28:22.119 We can call this the radius 425 00:28:22.119 --> 00:28:26.800 And usually, when we talk about angles, we talk about two things 426 00:28:26.800 --> 00:28:31.479 There are degrees, and then there are radians 427 00:28:31.479 --> 00:28:34.920 Degree refers to 360 degrees from 0 as we know it 428 00:28:34.920 --> 00:28:37.199 And radian means that 429 00:28:37.199 --> 00:28:41.000 If the radius is R 430 00:28:41.000 --> 00:28:43.680 This much of this circle here will be R 431 00:28:43.680 --> 00:28:46.400 This is R, the length of R will be the same 432 00:28:46.400 --> 00:28:49.319 Here, we do it like this 433 00:28:49.319 --> 00:28:53.760 This is now 1 rad, 1 rad 434 00:28:53.760 --> 00:28:55.640 So, when you turn it like this 435 00:28:55.640 --> 00:28:57.160 You can say how many rads it is 436 00:28:57.160 --> 00:29:00.800 When you say pi radian, it is 180 degrees 437 00:29:00.800 --> 00:29:03.520 90 degrees is 2 minutes of pi 438 00:29:03.520 --> 00:29:07.239 And 180 degrees is pi 439 00:29:07.239 --> 00:29:08.560 So, we can express it like this 440 00:29:08.560 --> 00:29:11.160 But in the end, this is 90 degrees 441 00:29:11.160 --> 00:29:14.560 And 180 degrees 442 00:29:14.560 --> 00:29:18.319 So, what is cosine 90? 443 00:29:18.319 --> 00:29:20.760 It's 0, cosine 90 is 0 444 00:29:20.760 --> 00:29:22.520 Cosine 0 is 1 445 00:29:22.520 --> 00:29:25.079 A cosine of 180 is minus 1 446 00:29:25.079 --> 00:29:26.199 With this concept 447 00:29:26.199 --> 00:29:27.280 So it's the same as this 448 00:29:27.280 --> 00:29:28.920 1, 0 minus 1 449 00:29:28.920 --> 00:29:31.040 Right? 1 0 minus 1 450 00:29:31.040 --> 00:29:33.959 This is 1, 0, and minus 1 451 00:29:33.959 --> 00:29:35.719 Right? Depending on the angle 452 00:29:35.719 --> 00:29:37.680 This is where the angle increases 453 00:29:37.680 --> 00:29:41.040 So if the angle is 0 degrees, it is 1, if it is 90 degrees, it is 0 454 00:29:41.160 --> 00:29:43.959 Ad if it reaches 180 degrees, it is minus 1 455 00:29:43.959 --> 00:29:45.239 456 00:29:45.239 --> 00:29:47.880 So you can see the same result as this 457 00:29:47.880 --> 00:29:50.680 Anyway, if you use this vector's dot product 458 00:29:50.680 --> 00:29:53.319 To this dot product 459 00:29:53.319 --> 00:29:56.520 If there is a reference direction like this 460 00:29:56.520 --> 00:29:59.319 You can multiply the reference direction by another vector 461 00:29:59.319 --> 00:30:02.560 And dot it to find the same direction 462 00:30:02.560 --> 00:30:04.719 Or the opposite direction 463 00:30:04.719 --> 00:30:07.839 I'm going to try to use this to get it 464 00:30:07.839 --> 00:30:10.319 I said this now means the front 465 00:30:10.319 --> 00:30:13.040 So, just dot the front vector 466 00:30:13.040 --> 00:30:15.479 And the forward vector 467 00:30:15.479 --> 00:30:18.920 So here we have Get Forward Vector 468 00:30:18.920 --> 00:30:21.439 On this Pawn 469 00:30:21.439 --> 00:30:24.400 Vector Forward Vector, here it is 470 00:30:24.400 --> 00:30:27.719 Dot the Forward Vector and this Velocity 471 00:30:27.719 --> 00:30:29.239 It's called Dot 472 00:30:29.239 --> 00:30:31.479 Dot Products 473 00:30:31.479 --> 00:30:33.119 Then, a float value appears 474 00:30:33.119 --> 00:30:35.040 You can put this here 475 00:30:35.040 --> 00:30:39.280 And we'll bring the direction like this 476 00:30:39.280 --> 00:30:43.199 Do this Velocity and Right Vector 477 00:30:43.199 --> 00:30:44.319 and do it this time 478 00:30:44.319 --> 00:30:49.479 So I will take this Get Vector Right Vector 479 00:30:49.479 --> 00:30:51.280 Bring this 480 00:30:51.280 --> 00:30:56.479 And dot these two 481 00:30:56.479 --> 00:31:00.319 Just dot it like this and insert it 482 00:31:00.319 --> 00:31:02.040 I am currently working on Blueprint 483 00:31:02.040 --> 00:31:05.439 But I will try to do this again in C++ 484 00:31:05.439 --> 00:31:07.959 If you do this and run it 485 00:31:07.959 --> 00:31:10.119 It walks like this when moving back and forth 486 00:31:10.119 --> 00:31:14.439 But the animation does not work when moving left or right 487 00:31:14.439 --> 00:31:19.160 You can see the results like this 488 00:31:19.160 --> 00:31:23.040 Well, this time, we're going to make a jump 489 00:31:23.040 --> 00:31:24.479 here needs to be an animation 490 00:31:24.479 --> 00:31:29.040 to make the jump happen 491 00:31:29.040 --> 00:31:31.520 So, I prepared a jump 492 00:31:31.520 --> 00:31:34.680 And I'll try using it 493 00:31:34.680 --> 00:31:38.920 So, an animation folder here 494 00:31:38.920 --> 00:31:40.040 It seems a little awkward to put together 495 00:31:40.040 --> 00:31:42.400 So, I will create another folder 496 00:31:42.400 --> 00:31:43.680 Under the animation folder 497 00:31:43.680 --> 00:31:47.680 This is called a jump 498 00:31:47.680 --> 00:31:48.920 I'll put it here 499 00:31:48.920 --> 00:31:50.560 This is filtered now 500 00:31:50.560 --> 00:31:52.199 But I'll turn it off 501 00:31:52.199 --> 00:31:54.000 I'll return it to its original state 502 00:31:54.000 --> 00:31:55.719 In the Jump folder here 503 00:31:55.719 --> 00:31:59.920 I'll put the player jump like this 504 00:31:59.920 --> 00:32:01.160 Then ask this 505 00:32:01.160 --> 00:32:02.760 What Skeleton are you going to use? 506 00:32:03.040 --> 00:32:04.760 The jump I prepared now is 507 00:32:04.760 --> 00:32:08.040 Probably also for Unreal 4 508 00:32:08.040 --> 00:32:09.199 So here it is 509 00:32:09.199 --> 00:32:11.880 Not this one, but the one below 510 00:32:11.880 --> 00:32:14.099 Select this 511 00:32:14.099 --> 00:32:15.599 And we are going to import this 512 00:32:15.599 --> 00:32:17.079 But if you do so, you will probably get an error 513 00:32:17.079 --> 00:32:22.479 So, if you open Advance here 514 00:32:22.479 --> 00:32:25.640 There is a Snap to Closer Frame 515 00:32:25.640 --> 00:32:26.239 Like this 516 00:32:26.239 --> 00:32:28.959 Please check this 517 00:32:28.959 --> 00:32:31.400 I will import it like this 518 00:32:31.400 --> 00:32:36.959 Then, the animation was imported like this 519 00:32:36.959 --> 00:32:42.160 Then, the animation looks like this 520 00:32:42.160 --> 00:32:46.599 We will retarget all of this as well 521 00:32:46.599 --> 00:32:48.400 What we are doing now is retargeting 522 00:32:48.400 --> 00:32:51.520 So, use a retargeting animation asset 523 00:32:51.520 --> 00:32:53.359 Duplicate 524 00:32:53.359 --> 00:32:54.920 After specifying it 525 00:32:54.920 --> 00:32:59.239 In the same format as before 526 00:32:59.239 --> 00:33:01.479 This is asking what you want to do with the preset now 527 00:33:01.479 --> 00:33:02.319 So you don't have to change it 528 00:33:02.319 --> 00:33:04.920 But I'll do it together while I'm doing it 529 00:33:04.920 --> 00:33:08.359 Select a folder 530 00:33:08.359 --> 00:33:10.880 And then jump 531 00:33:10.880 --> 00:33:12.119 This, too, is a bit ambiguous 532 00:33:12.119 --> 00:33:13.599 The names would be the same 533 00:33:13.599 --> 00:33:17.079 Let's just put it in the animation folder for now 534 00:33:17.079 --> 00:33:21.160 Let's do this and do retargeting 535 00:33:21.160 --> 00:33:24.680 Then, the animation would have worked well like this 536 00:33:24.680 --> 00:33:30.920 Looking at this 537 00:33:30.920 --> 00:33:34.000 It seems to be working well 538 00:33:34.000 --> 00:33:41.560 Then, I will delete the jump that I placed below 539 00:33:41.560 --> 00:33:43.880 In this way, we have now secured an animation 540 00:33:43.880 --> 00:33:45.599 That allows jumping 541 00:33:45.599 --> 00:33:49.319 So let's come over here and go to 542 00:33:49.319 --> 00:33:52.479 Move FSM in AnimGraph 543 00:33:52.479 --> 00:33:54.719 Then, there needs to be one variable 544 00:33:54.719 --> 00:33:58.160 This means I will create a variable 545 00:33:58.160 --> 00:34:01.160 To check whether I am in the air 546 00:34:01.160 --> 00:34:04.640 We will do it with a Bool type 547 00:34:04.640 --> 00:34:08.840 And we will call this IsInAir 548 00:34:08.840 --> 00:34:10.600 You can name it IsFalling 549 00:34:10.600 --> 00:34:13.239 It means are you in the air 550 00:34:13.239 --> 00:34:14.760 So it feels like 551 00:34:14.760 --> 00:34:19.879 I was moving and ended up in the air 552 00:34:19.879 --> 00:34:23.159 Then you start jumping from there 553 00:34:23.159 --> 00:34:27.879 If you look, there are three jump movements instead of one 554 00:34:27.879 --> 00:34:32.159 They are in three forms: Start, Loop, and End 555 00:34:32.159 --> 00:34:35.120 So, this will be a lunge before jumping 556 00:34:35.120 --> 00:34:37.879 This is posing in the air 557 00:34:37.879 --> 00:34:40.399 And a landing motion when it touches the ground 558 00:34:40.399 --> 00:34:43.239 I will make it into three parts like this 559 00:34:43.239 --> 00:34:46.080 So I'll arrange them here 560 00:34:46.080 --> 00:34:51.679 If you say jump in an animation, it will appear 561 00:34:51.679 --> 00:34:59.600 There are three here: Start, Loop, and End 562 00:34:59.600 --> 00:35:01.159 I can handle this 563 00:35:01.159 --> 00:35:04.600 But for now, I won't be using it in the end 564 00:35:04.600 --> 00:35:07.239 I will change the Blend Space later 565 00:35:07.239 --> 00:35:09.760 But I will arrange it 566 00:35:09.760 --> 00:35:13.959 So it can only jump like this in the Idle position 567 00:35:13.959 --> 00:35:16.439 Connect it like this 568 00:35:16.439 --> 00:35:18.280 Connect it like this 569 00:35:18.280 --> 00:35:21.800 And it goes like this 570 00:35:21.800 --> 00:35:24.439 So when it jumps, it'll start 571 00:35:24.439 --> 00:35:25.959 When it's done, it'll do a loop 572 00:35:25.959 --> 00:35:29.199 When it hits the ground, it does a landing motion 573 00:35:29.199 --> 00:35:31.479 And then take the Idle posture again 574 00:35:31.479 --> 00:35:33.159 I'll do in that way 575 00:35:33.159 --> 00:35:36.080 Then, when the condition here is 576 00:35:36.080 --> 00:35:39.959 Is In Air is True 577 00:35:39.959 --> 00:35:42.639 It stays still while floating in the ai 578 00:35:42.639 --> 00:35:45.120 And then becomes empty 579 00:35:45.120 --> 00:35:47.120 This means that when your feet are not touching the ground 580 00:35:47.120 --> 00:35:49.199 You perform a jumping motion 581 00:35:49.199 --> 00:35:51.239 Specify it like this 582 00:35:51.239 --> 00:35:53.520 Then, when this operation is over 583 00:35:53.520 --> 00:35:55.959 It will automatically go to the loop state 584 00:35:55.959 --> 00:35:57.320 If you select here 585 00:35:57.320 --> 00:36:01.320 You will see the Automation rules of Detail, etc 586 00:36:01.320 --> 00:36:03.280 So, if you check this 587 00:36:03.280 --> 00:36:05.159 It means that when this animation is finished 588 00:36:05.159 --> 00:36:08.719 The transition will be performed automatically 589 00:36:08.719 --> 00:36:10.520 So, let me check this 590 00:36:10.560 --> 00:36:12.800 And in the loop 591 00:36:12.800 --> 00:36:15.120 It's empty in the air 592 00:36:15.120 --> 00:36:17.520 If I say Is In Air is False 593 00:36:17.520 --> 00:36:19.360 It's landed on the ground 594 00:36:19.360 --> 00:36:21.080 It touched the ground 595 00:36:21.080 --> 00:36:23.199 Then, it does the landing motion 596 00:36:23.199 --> 00:36:25.239 So, for this condition 597 00:36:25.239 --> 00:36:26.840 I'll put Is In Air 598 00:36:26.840 --> 00:36:30.080 And put here when it is False 599 00:36:30.080 --> 00:36:33.399 Then there are things like Not Boolean here 600 00:36:33.399 --> 00:36:34.560 In this way 601 00:36:34.560 --> 00:36:37.879 It is now in charge of changing True to False 602 00:36:37.879 --> 00:36:39.080 It's Not 603 00:36:39.080 --> 00:36:46.159 After doing this, I will put it in like this 604 00:36:46.159 --> 00:36:49.479 And once this landing movement is over 605 00:36:49.479 --> 00:36:52.840 It should automatically come to standing still like this 606 00:36:52.840 --> 00:36:55.719 So, I will also check 607 00:36:55.719 --> 00:36:59.959 The Automatic rule Base 608 00:36:59.959 --> 00:37:01.320 Configure it like this 609 00:37:01.320 --> 00:37:03.320 When we see IsInAir 610 00:37:03.320 --> 00:37:04.919 Let's take a quick look in the preview 611 00:37:04.919 --> 00:37:08.320 If you check this 612 00:37:08.320 --> 00:37:10.439 It is here now 613 00:37:10.439 --> 00:37:12.080 It is here right now 614 00:37:12.080 --> 00:37:14.399 That's why it can't go this way 615 00:37:14.399 --> 00:37:17.760 I will test this with the speed set to 0 616 00:37:17.760 --> 00:37:20.159 If you check IsInAir, it will float in the air 617 00:37:20.159 --> 00:37:25.600 And if you uncheck it again, it will touch the ground 618 00:37:25.600 --> 00:37:28.560 In this way, you can now jump 619 00:37:28.560 --> 00:37:32.399 Then, to jump 620 00:37:32.399 --> 00:37:35.040 We need to do some processing 621 00:37:35.040 --> 00:37:37.399 If you look here 622 00:37:37.399 --> 00:37:41.439 What this guy has now is that 623 00:37:41.439 --> 00:37:43.800 It has a Movement component 624 00:37:43.800 --> 00:37:45.879 It would be the Get Movement component 625 00:37:45.879 --> 00:37:47.439 But instead of this 626 00:37:47.439 --> 00:37:52.800 I have to change that to a Character Movement component and use it 627 00:37:52.800 --> 00:37:55.199 So, I used this as is 628 00:37:55.199 --> 00:37:58.080 But I think I need to cast it and use it now 629 00:37:58.080 --> 00:38:06.919 So, after replacing this with Cast To TPS Player 630 00:38:06.919 --> 00:38:12.479 Let's do this last 631 00:38:12.479 --> 00:38:16.520 After casting like this 632 00:38:16.520 --> 00:38:26.000 Here's the Get Character Movement component 633 00:38:26.000 --> 00:38:29.360 Here it is, I'll bring this 634 00:38:29.360 --> 00:38:33.320 There's something called IsFalling inside here 635 00:38:33.320 --> 00:38:35.719 With this 636 00:38:35.719 --> 00:38:44.120 I'll fill this 637 00:38:44.120 --> 00:38:47.639 Compile 638 00:38:47.639 --> 00:38:51.120 If you run it, it jumps 639 00:38:51.120 --> 00:38:52.120 Not when moving 640 00:38:52.120 --> 00:38:54.600 Now that we've configured it that way 641 00:38:54.600 --> 00:39:04.399 You can see that the jump works well like this 642 00:39:04.399 --> 00:39:08.439 So, shall we try controlling this in C++? 643 00:39:08.439 --> 00:39:11.639 Come over here 644 00:39:11.639 --> 00:39:13.479 It's an Anim instance 645 00:39:13.479 --> 00:39:19.280 Then, in Tools 646 00:39:19.280 --> 00:39:21.120 Let's search for it here 647 00:39:21.120 --> 00:39:25.439 Anim instance here 648 00:39:25.439 --> 00:39:27.439 I'll create a class that inherits this 649 00:39:27.439 --> 00:39:29.919 So this is the player name 650 00:39:29.919 --> 00:39:36.520 So we'll call it TPS 651 00:39:36.520 --> 00:39:53.280 Create 652 00:39:53.280 --> 00:39:56.639 If you look here 653 00:39:56.639 --> 00:40:00.439 We are currently working on this 654 00:40:00.439 --> 00:40:03.320 In Blueprint Update Animation 655 00:40:03.320 --> 00:40:09.800 So, the Player Anim's header looks like this 656 00:40:09.800 --> 00:40:14.520 That's why it's called public 657 00:40:14.520 --> 00:40:26.080 This is not a blueprint, so you can do it with a virtual update animation 658 00:40:26.080 --> 00:40:27.879 Like this 659 00:40:27.919 --> 00:40:31.439 The parameter is 660 00:40:31.439 --> 00:40:34.760 Delta time 661 00:40:34.760 --> 00:40:39.520 When looking for this, go to Anim Instance and search here 662 00:40:39.520 --> 00:40:40.560 It looks like this 663 00:40:40.560 --> 00:40:49.280 I'll just duplicate this and write it like this 664 00:40:49.280 --> 00:40:53.679 In this way, you can create the implementation part by pressing Alt-Enter 665 00:40:53.679 --> 00:40:56.560 I will write it right here 666 00:40:56.560 --> 00:40:59.800 In the Blueprint, we created three variables earlier 667 00:40:59.800 --> 00:41:02.639 We created Speed ​​Direction In Is In Air, right? 668 00:41:02.639 --> 00:41:06.840 I'll make this 669 00:41:06.840 --> 00:41:14.000 In here, New Property 670 00:41:14.000 --> 00:41:20.040 Edit Anywhere 671 00:41:20.040 --> 00:41:24.199 And create a variable like Plus Speed 672 00:41:24.199 --> 00:41:29.679 However, to be able to use this in Blueprint 673 00:41:29.679 --> 00:41:35.600 You must use Blueprint Read Only or Read Light 674 00:41:35.600 --> 00:41:38.000 For now, we just leave it open 675 00:41:38.000 --> 00:41:41.320 Let's add a Blueprint leadlight 676 00:41:41.320 --> 00:41:44.399 There are three things: Speed, Direction, IsInAir 677 00:41:44.399 --> 00:41:49.879 Speed, Direction 678 00:41:49.879 --> 00:41:57.959 I created the Bool type IsInAir variable like this 679 00:41:57.959 --> 00:42:06.040 I'll fill this in as I update 680 00:42:06.040 --> 00:42:11.239 Let's go over here, and there are three things 681 00:42:11.239 --> 00:42:18.040 Speed, Direction, and IsInAir 682 00:42:18.040 --> 00:42:21.560 To do this, you first need to bring an owner 683 00:42:21.560 --> 00:42:25.560 You can say try get pawn owner 684 00:42:25.560 --> 00:42:27.439 You can use this as is 685 00:42:27.439 --> 00:42:30.439 Then, what we will do with this is 686 00:42:30.439 --> 00:42:34.439 Iit is a TPS player 687 00:42:34.439 --> 00:42:39.959 TPS player 688 00:42:39.959 --> 00:42:41.600 The automaticity isn't working very well 689 00:42:41.600 --> 00:42:47.320 So, let's call it a player 690 00:42:47.320 --> 00:43:00.560 Do casting 691 00:43:00.560 --> 00:43:03.280 Let's add a header 692 00:43:03.280 --> 00:43:05.679 Then you can use the player like this 693 00:43:05.679 --> 00:43:10.520 You can get velocity from the player 694 00:43:10.520 --> 00:43:18.840 Looking at this in Fvector 695 00:43:18.840 --> 00:43:20.199 You will see a dot product 696 00:43:20.199 --> 00:43:24.159 will use this to find the direction 697 00:43:24.159 --> 00:43:26.760 And since this is now velocity 698 00:43:26.760 --> 00:43:27.959 Should I create it separately? 699 00:43:27.959 --> 00:43:33.399 Velocity with fvector 700 00:43:33.399 --> 00:43:34.600 I'll do like this 701 00:43:34.600 --> 00:43:39.040 fvector forward 702 00:43:39.040 --> 00:43:46.199 This will be the forward vector 703 00:43:46.199 --> 00:43:50.800 And there is also a right vector 704 00:43:50.800 --> 00:43:55.479 For the right, here is the right vector 705 00:43:55.479 --> 00:43:57.439 After doing like this 706 00:43:57.439 --> 00:43:59.040 We will now do dots 707 00:43:59.040 --> 00:44:05.520 Let's go forward and then dot the velocity 708 00:44:05.520 --> 00:44:10.199 We will put this value in the speed 709 00:44:10.199 --> 00:44:15.120 And do the same thing, this to the direction 710 00:44:15.120 --> 00:44:20.159 And this is the right vector 711 00:44:20.159 --> 00:44:23.560 I'll make sure to fill it out in IsIn as well 712 00:44:23.560 --> 00:44:32.639 Here is the player's character movement 713 00:44:32.639 --> 00:44:34.120 After we import this 714 00:44:34.120 --> 00:44:37.399 We will fill in the isFalling value here 715 00:44:37.399 --> 00:44:44.679 To use this, you need to add a header like this 716 00:44:44.679 --> 00:44:53.520 You need to add this to the game framework 717 00:44:53.520 --> 00:44:57.719 Like this to use it 718 00:44:57.719 --> 00:45:01.479 And this shouldn't be done when the player is null 719 00:45:01.479 --> 00:45:07.159 We will fill it only when it is not null 720 00:45:07.159 --> 00:45:10.320 I'll check for null like this 721 00:45:10.320 --> 00:45:12.760 Then, configure it like this 722 00:45:12.760 --> 00:45:15.000 Then we need to change its parent 723 00:45:15.000 --> 00:45:24.560 After doing this, I will compile it first 724 00:45:24.560 --> 00:45:30.840 Now, to change the parent 725 00:45:30.840 --> 00:45:34.159 We will change it to tps-play-anim like this 726 00:45:34.159 --> 00:45:37.159 Then, the existing values ​​change like this 727 00:45:37.159 --> 00:45:39.840 Which should now be deleted 728 00:45:39.840 --> 00:45:46.840 Let's delete the contents of the blueprint here like this 729 00:45:46.840 --> 00:45:50.800 I'm deleting all of this 730 00:45:50.800 --> 00:45:53.879 The things that were processed at speed after 731 00:45:53.879 --> 00:45:55.919 That will now be removed 732 00:45:55.919 --> 00:46:01.320 Still, you created a condition here 733 00:46:01.320 --> 00:46:05.719 If you look at it this way, the speed 734 00:46:05.719 --> 00:46:07.919 Yes, the speed will be 0 735 00:46:07.919 --> 00:46:13.760 So, I used find-reference, and it looks like this 736 00:46:13.760 --> 00:46:15.159 But let's delete this first 737 00:46:15.159 --> 00:46:18.639 Speed 738 00:46:18.639 --> 00:46:20.040 If you delete this, you will get an error 739 00:46:20.040 --> 00:46:23.919 If you do this, you can bring this here at speed 740 00:46:23.919 --> 00:46:27.919 Get speed, and fill it out like this 741 00:46:27.919 --> 00:46:30.239 It's here, too, copy it 742 00:46:30.239 --> 00:46:34.840 And it's here, too, put it in like this 743 00:46:34.840 --> 00:46:43.760 Fill everything out like this 744 00:46:43.760 --> 00:46:47.760 And let's see if the direction is also being used 745 00:46:47.760 --> 00:46:51.040 If you right-click and use find-reference like this 746 00:46:51.040 --> 00:46:53.159 You will see that this is not currently in use 747 00:46:53.159 --> 00:46:56.959 I think I can just delete it 748 00:46:56.959 --> 00:46:59.919 We process it like this 749 00:46:59.919 --> 00:47:04.800 When we return, it is reflected well here 750 00:47:04.800 --> 00:47:06.919 Then let's try running it 751 00:47:06.919 --> 00:47:09.159 Jump like this 752 00:47:09.159 --> 00:47:12.120 It works, right? 753 00:47:12.120 --> 00:47:17.760 In this way, we can use it interchangeably in C++ 754 00:47:17.760 --> 00:47:23.320 Then, finally 755 00:47:23.320 --> 00:47:24.679 I structured it like this 756 00:47:24.679 --> 00:47:27.199 But this is getting a little complicated now 757 00:47:27.199 --> 00:47:29.360 This is just front and back 758 00:47:29.560 --> 00:47:33.239 But adding left, right, and diagonal lines 759 00:47:33.239 --> 00:47:35.479 Becomes difficult to process 760 00:47:35.479 --> 00:47:38.679 So I'm going to create something to replace this 761 00:47:38.679 --> 00:47:43.040 And I'm going to come over here and create it on the Blueprint 762 00:47:43.040 --> 00:47:46.959 If you right-click and look at the animation 763 00:47:46.959 --> 00:47:49.639 There is something called Blend Space 764 00:47:49.639 --> 00:47:51.239 Click thi 765 00:47:51.239 --> 00:47:55.320 Likewise, you need to specify the skeleton 766 00:47:56.320 --> 00:48:02.399 Next, let's call this a BS_TPS player 767 00:48:02.399 --> 00:48:04.879 If you write like this and double-click 768 00:48:04.879 --> 00:48:09.360 To see here, there are two Horizontal vertical axes 769 00:48:09.360 --> 00:48:11.320 You can unfold it like this 770 00:48:11.320 --> 00:48:13.120 The name here is 771 00:48:13.120 --> 00:48:15.000 Horizontal, which is our direction 772 00:48:15.000 --> 00:48:16.879 It's called Direction 773 00:48:16.879 --> 00:48:21.000 Next, the vertical is called speed 774 00:48:21.000 --> 00:48:22.000 Like this 775 00:48:22.000 --> 00:48:25.600 Then, this is the vertical and this is horizontal 776 00:48:25.600 --> 00:48:28.800 Then, you can place the animation here 777 00:48:28.800 --> 00:48:33.120 But let's do Idle first 778 00:48:33.120 --> 00:48:35.320 Let's put Idle in the middle 779 00:48:35.320 --> 00:48:37.399 But it doesn't fit well when placed 780 00:48:37.399 --> 00:48:41.080 If you press Shift, you can place it exactly on the point 781 00:48:41.080 --> 00:48:43.719 Let's place it while holding down Shift 782 00:48:43.719 --> 00:48:48.040 After that, you say work 783 00:48:48.040 --> 00:48:52.439 Next, I'll place this backward here 784 00:48:52.439 --> 00:48:54.639 Forward 785 00:48:54.639 --> 00:48:57.159 Left 786 00:48:57.159 --> 00:48:59.159 And right 787 00:48:59.159 --> 00:49:00.879 Then, if you press the Ctrl key 788 00:49:00.879 --> 00:49:03.159 You can move the focus like this 789 00:49:03.159 --> 00:49:05.040 I didn't click the mouse 790 00:49:05.040 --> 00:49:07.320 If you move the mouse while holding the Ctrl key 791 00:49:07.320 --> 00:49:11.199 The animation will blend like this 792 00:49:11.199 --> 00:49:12.800 Mix it like this 793 00:49:12.800 --> 00:49:15.040 Do the diagonal like this 794 00:49:15.040 --> 00:49:16.280 Since it has this function 795 00:49:16.280 --> 00:49:18.479 I'm going to give it a try 796 00:49:18.479 --> 00:49:22.840 Do this and save 797 00:49:22.840 --> 00:49:24.600 Then I came back here 798 00:49:24.600 --> 00:49:25.679 And did this now 799 00:49:25.679 --> 00:49:27.320 But I don't use this anymore 800 00:49:27.320 --> 00:49:33.639 Here instead 801 00:49:33.639 --> 00:49:37.239 I think I should process it like this 802 00:49:37.239 --> 00:49:39.639 Let's create a node 803 00:49:39.639 --> 00:49:41.040 It's called add state 804 00:49:41.040 --> 00:49:44.800 Let's say move bs. 805 00:49:44.800 --> 00:49:46.439 This is a blend space 806 00:49:46.439 --> 00:49:48.679 Let's go here and look at this 807 00:49:48.679 --> 00:49:52.439 This is the bs tps player we made earlier, right? 808 00:49:52.439 --> 00:49:53.280 I'll write it down as is 809 00:49:53.280 --> 00:49:56.879 BS_TPSPlayer 810 00:49:56.879 --> 00:49:58.000 If you do this, it will come out like this 811 00:49:58.000 --> 00:49:59.679 Shall we do the one on the top? 812 00:49:59.679 --> 00:50:01.719 If you press this, it will appear like this 813 00:50:01.719 --> 00:50:04.199 Bring our direction like this 814 00:50:04.199 --> 00:50:06.959 Get direction 815 00:50:06.959 --> 00:50:11.280 Get speed 816 00:50:11.280 --> 00:50:12.199 And put it here like this 817 00:50:12.199 --> 00:50:14.959 Like this 818 00:50:14.959 --> 00:50:17.399 It is a variable created in C++ 819 00:50:17.399 --> 00:50:19.280 If you do it like this, it will happen like this 820 00:50:19.280 --> 00:50:21.239 Then, put this in the output 821 00:50:21.239 --> 00:50:23.639 And compile it 822 00:50:23.639 --> 00:50:25.239 You will get something like this 823 00:50:25.239 --> 00:50:27.080 It looks like this 824 00:50:27.080 --> 00:50:28.520 After doing this, we returned 825 00:50:28.520 --> 00:50:31.199 And did not use the existing content 826 00:50:31.199 --> 00:50:33.120 Let's put this aside 827 00:50:33.120 --> 00:50:35.719 And try this 828 00:50:35.719 --> 00:50:37.600 Then we'll have to make this again 829 00:50:37.600 --> 00:50:39.320 I'll cut this off 830 00:50:39.320 --> 00:50:43.120 If you hold down Alt and click, it will hang 831 00:50:43.120 --> 00:50:46.639 Arrange it like this again 832 00:50:46.639 --> 00:50:49.280 The entry is also connected here 833 00:50:49.280 --> 00:50:51.840 I'm not using this anymore 834 00:50:51.840 --> 00:50:56.040 I'll come here and use this 835 00:50:56.040 --> 00:50:57.399 Because this is a jump 836 00:50:57.399 --> 00:51:02.639 Bring this back to IsInAir 837 00:51:02.639 --> 00:51:05.639 And put it back in 838 00:51:05.639 --> 00:51:07.639 Which is automatic 839 00:51:07.639 --> 00:51:10.520 Automatically check it like this 840 00:51:10.520 --> 00:51:12.760 After thinking about it 841 00:51:12.760 --> 00:51:15.919 I think I made a mistake with this Blend Space range 842 00:51:15.919 --> 00:51:19.560 This is direction 600 and -600 843 00:51:19.560 --> 00:51:21.800 It should be done like this 844 00:51:21.800 --> 00:51:24.239 Then for the speed 845 00:51:24.239 --> 00:51:28.679 x to 600 and this to -600 846 00:51:28.679 --> 00:51:32.199 Let's readjust the speed range 847 00:51:32.239 --> 00:51:36.120 Please change the location like this again 848 00:51:36.120 --> 00:51:40.679 If you hold down Shift and move it around, you can stick it like this 849 00:51:40.679 --> 00:51:44.399 After configuring it like this 850 00:51:44.399 --> 00:51:46.479 Save it and return it 851 00:51:46.479 --> 00:51:48.639 To Blend Space, and if you do this 852 00:51:48.639 --> 00:51:50.879 There are times when it is not reflected properly 853 00:51:50.879 --> 00:51:53.840 So, let me erase it and reflect on it again 854 00:51:53.840 --> 00:51:57.439 You can put the Blend Space here like this 855 00:51:57.439 --> 00:52:00.560 Blend Space can be 856 00:52:00.560 --> 00:52:03.719 Put it in like this 857 00:52:03.719 --> 00:52:07.919 Please connect like this 858 00:52:07.919 --> 00:52:09.080 Compile 859 00:52:09.080 --> 00:52:12.479 Then, it will be reflected well 860 00:52:12.479 --> 00:52:14.120 Let's run it 861 00:52:14.120 --> 00:52:18.600 It seems to reflect well left and right, forward and backward 862 00:52:18.600 --> 00:52:27.600 You can now jump while walking 863 00:52:27.600 --> 00:52:30.800 Let us summarize what we learned in this lecture 864 00:52:31.464 --> 00:52:32.364 Processing animation movements using Blueprints Movement state animation Add animation assets to the project and create the ABP_TPSPalyer blueprint 865 00:52:32.364 --> 00:52:33.214 Transition is connected in both directions between [standby state] and [moving state] in each direction Connect the Float type Speed ​​variable to each [float] comparison node 866 00:52:33.214 --> 00:52:34.064 Create a [Vector Length] node connected to the [Get Velocity] node and add the Speed ​​variable as a [Set] node 867 00:52:34.064 --> 00:52:34.914 Connect the execution pin when the [Cast To ABP_TPSPalyer] node succeeds and the [Speed ​​Set] node 868 00:52:34.914 --> 00:52:35.764 After adding the Direction variable, the inner product of the vector is used to process the forward/backward movement and left/right movement to be different 869 00:52:35.764 --> 00:52:36.614 Jump State Animation After registering JumpStart, connect the [Idle] state node and transition 870 00:52:36.614 --> 00:52:37.464 After declaring IsInAir, a variable to remember whether it is in the air, set it so that a transition occurs when it is true 871 00:52:37.464 --> 00:52:38.514 [Idle] state node - [Jumpstart] - [JumpLoop] - [JumpEnd] - [Idle] State node connects transitions and sets conditions 872 00:52:38.578 --> 00:52:39.528 Handling animation motion using C++ and blendspace Action processing using C++ Search for AnimInstance and create TPSPlayerAnim as an inherited class 873 00:52:39.528 --> 00:52:40.478 Copy the function declaration to the TPSPlayerAnim.h file and override it Enter BlueprintReadWrite as a UPROPERTY specifier so that it can be used in blueprints 874 00:52:40.478 --> 00:52:41.328 After declaring Speed, Direction, and IsInAir variables, assign appropriate values ​​to each variable 875 00:52:41.328 --> 00:52:42.078 Motion processing using blendspace After creating a blend space, name it BS_TPSPlayer 876 00:52:42.078 --> 00:52:42.978 Set blend space axis values ​​in the Asset Details window Register [Idle_Rifle_Ironsights] in the editor grid window and place animation sequences for each direction 877 00:52:42.978 --> 00:52:44.028 [MoveBS] After creating the state node, select Blendspace 'BS_TPSPlayer' to create the [BS_TPSPlayer] node 878 00:52:44.028 --> 00:52:45.128 After adding Direction, Speed, and variables, connect them to Direction and Speed ​​of the [BS_TPSPlayer] node, respectively 879 00:52:45.128 --> 00:52:46.228 [MoveBS] - [JumpStart], [JumpEnd] - Connect transitions in the [MoveBS] direction Register the IsInAir variable in the graph window and connect it to the [Result] node