All language subtitles for 008 Setting Up Animations with PaperZD[UdemyIran.Com]

af Afrikaans
sq Albanian
am Amharic
ar Arabic
hy Armenian
az Azerbaijani
eu Basque
be Belarusian
bn Bengali
bs Bosnian
bg Bulgarian
ca Catalan
ceb Cebuano
ny Chichewa
zh-CN Chinese (Simplified)
zh-TW Chinese (Traditional)
co Corsican
hr Croatian
cs Czech
da Danish
nl Dutch
en English
eo Esperanto
et Estonian
tl Filipino
fi Finnish
fr French
fy Frisian
gl Galician
ka Georgian
de German
el Greek
gu Gujarati
ht Haitian Creole
ha Hausa
haw Hawaiian
iw Hebrew
hi Hindi
hmn Hmong
hu Hungarian
is Icelandic
ig Igbo
id Indonesian
ga Irish
it Italian
ja Japanese
jw Javanese
kn Kannada
kk Kazakh
km Khmer
ko Korean
ku Kurdish (Kurmanji)
ky Kyrgyz
lo Lao
la Latin
lv Latvian
lt Lithuanian
lb Luxembourgish
mk Macedonian
mg Malagasy
ms Malay
ml Malayalam
mt Maltese
mi Maori
mr Marathi
mn Mongolian
my Myanmar (Burmese)
ne Nepali
no Norwegian
ps Pashto
fa Persian Download
pl Polish
pt Portuguese
pa Punjabi
ro Romanian
ru Russian
sm Samoan
gd Scots Gaelic
sr Serbian
st Sesotho
sn Shona
sd Sindhi
si Sinhala
sk Slovak
sl Slovenian
so Somali
es Spanish
su Sundanese
sw Swahili
sv Swedish
tg Tajik
ta Tamil
te Telugu
th Thai
tr Turkish
uk Ukrainian
ur Urdu
uz Uzbek
vi Vietnamese
cy Welsh
xh Xhosa
yi Yiddish
yo Yoruba
zu Zulu
or Odia (Oriya)
rw Kinyarwanda
tk Turkmen
tt Tatar
ug Uyghur
Would you like to inspect the original subtitles? These are the user uploaded subtitles that are being translated: 1 00:00:00,200 --> 00:00:04,520 In this video, we're going to implement the actual animations and animation switching through Paper 2 00:00:04,520 --> 00:00:05,000 XRD. 3 00:00:05,300 --> 00:00:10,160 Of course, we can also switch between animations without the free Paper XRD plugin, and we will actually 4 00:00:10,160 --> 00:00:11,870 do that for some elements later on. 5 00:00:11,870 --> 00:00:16,910 But for something that is as complicated as a character, it saves us so much time and makes it so much 6 00:00:16,910 --> 00:00:17,960 more maintainable. 7 00:00:17,960 --> 00:00:19,520 So let's get started. 8 00:00:20,000 --> 00:00:26,660 In the content drawer, we want to go into the blueprints characters player folder, and in here we 9 00:00:26,660 --> 00:00:29,930 can right click and go to Paper XRD. 10 00:00:30,080 --> 00:00:32,479 And you can see that we have three different asset types. 11 00:00:32,479 --> 00:00:37,790 Here we have animation sequences animation source and a paper XRD Anim Blueprint. 12 00:00:37,820 --> 00:00:41,360 The first thing you always have to create is an animation source. 13 00:00:41,360 --> 00:00:47,060 So let's do this and call it as underscore player and open it up. 14 00:00:48,100 --> 00:00:54,310 An animation source basically is a collection of all the flipbooks that we want to use with this character. 15 00:00:54,460 --> 00:00:59,410 And so far, we can't really see much here because we first have to add a couple of the Flipbooks. 16 00:00:59,410 --> 00:01:02,950 Just click on Add New here new animation sequence. 17 00:01:02,950 --> 00:01:05,440 And the first one we want is idle. 18 00:01:05,440 --> 00:01:13,090 So just type in idle and we can then on the right side for animation data select the player idle. 19 00:01:13,790 --> 00:01:16,880 Like this and we can zoom out here. 20 00:01:17,000 --> 00:01:20,780 And yeah, it is basically just playing the animation here. 21 00:01:20,780 --> 00:01:24,920 You can see our you can see our timeline at the bottom here. 22 00:01:24,920 --> 00:01:29,060 We're going to use this later to add notifies add sound effects and things like that. 23 00:01:29,060 --> 00:01:34,610 But for now we just want to register all of the animations that we want to be available for this character. 24 00:01:34,820 --> 00:01:39,680 And the easiest way to do that is to just have this window open, but also open the content drawer. 25 00:01:39,680 --> 00:01:42,470 You can also do that again with control and space. 26 00:01:42,470 --> 00:01:48,140 And here we want to go to content paper assets characters and player. 27 00:01:48,140 --> 00:01:50,780 And here we can just like see all of our frames. 28 00:01:50,780 --> 00:01:54,050 And sadly there still is no automatic way of doing this. 29 00:01:54,050 --> 00:01:58,550 But I actually talked to the developer that this is a requested feature, and maybe he'll add it in 30 00:01:58,550 --> 00:02:03,740 the future because this process takes a couple of minutes just looking at all of the flipbooks and registering 31 00:02:03,740 --> 00:02:04,190 them here. 32 00:02:04,190 --> 00:02:06,440 So just having a shortcut would be very nice. 33 00:02:06,440 --> 00:02:08,810 But for now we still have to do this manually. 34 00:02:08,810 --> 00:02:10,520 So let's go through them one by one. 35 00:02:10,520 --> 00:02:11,870 So clamp is the next one. 36 00:02:11,870 --> 00:02:14,270 We can just add new new animation sequence. 37 00:02:14,270 --> 00:02:15,440 Call it clamp. 38 00:02:16,090 --> 00:02:19,630 In case you cannot rename it right away, you can just right click go to rename. 39 00:02:19,630 --> 00:02:23,410 If you mistyped and change the name like that and again for cleanup. 40 00:02:23,440 --> 00:02:24,280 Double click it. 41 00:02:24,280 --> 00:02:27,520 And on the right side here we just go for player climb. 42 00:02:28,140 --> 00:02:30,840 Just like this and go to the next one. 43 00:02:30,870 --> 00:02:31,740 The clamp. 44 00:02:31,740 --> 00:02:32,610 Shoot. 45 00:02:32,640 --> 00:02:35,310 So add new climb. 46 00:02:35,550 --> 00:02:36,600 Shoot. 47 00:02:36,600 --> 00:02:37,710 Like this. 48 00:02:38,220 --> 00:02:39,300 And here. 49 00:02:39,480 --> 00:02:40,950 Climb, shoot. 50 00:02:41,890 --> 00:02:44,470 Uh, actually, it's, uh, climb, underscore shoot here. 51 00:02:44,470 --> 00:02:45,640 Right, player. 52 00:02:45,640 --> 00:02:46,600 Climb, shoot. 53 00:02:46,600 --> 00:02:50,560 Select this one and the next one is player fall. 54 00:02:50,560 --> 00:02:51,820 So go here. 55 00:02:51,970 --> 00:02:53,110 Fall. 56 00:02:54,580 --> 00:02:57,100 And look for a player fall. 57 00:02:58,050 --> 00:03:02,520 And as you can see, this is a little bit of an annoying process, but this is the only way we can do 58 00:03:02,520 --> 00:03:03,390 so. 59 00:03:03,750 --> 00:03:05,580 Uh, fall shoot is the next one. 60 00:03:06,400 --> 00:03:06,820 Ball. 61 00:03:06,820 --> 00:03:07,660 Shoot. 62 00:03:08,570 --> 00:03:09,140 Here. 63 00:03:09,140 --> 00:03:09,920 Look for fall. 64 00:03:09,920 --> 00:03:10,580 Shoot. 65 00:03:12,380 --> 00:03:14,150 The next one is hurt. 66 00:03:14,150 --> 00:03:15,350 So go here. 67 00:03:16,180 --> 00:03:16,750 Hurt. 68 00:03:17,530 --> 00:03:18,220 On the right. 69 00:03:18,220 --> 00:03:21,010 Also select the hurt for the player. 70 00:03:21,520 --> 00:03:23,590 The next one idle we already put in. 71 00:03:23,590 --> 00:03:24,280 So this is fine. 72 00:03:24,280 --> 00:03:26,200 Idle shoot is the next one. 73 00:03:26,320 --> 00:03:27,790 So a new sequence. 74 00:03:27,790 --> 00:03:29,050 Idle shoot. 75 00:03:30,700 --> 00:03:32,980 And here also I'll shoot. 76 00:03:34,540 --> 00:03:36,910 The next one is jump. 77 00:03:36,940 --> 00:03:40,270 Uh, the next one is a jump rise. 78 00:03:40,420 --> 00:03:41,770 So new animation. 79 00:03:41,770 --> 00:03:43,120 Jump, rise. 80 00:03:44,030 --> 00:03:44,840 Here also. 81 00:03:44,840 --> 00:03:45,740 Jump. 82 00:03:45,740 --> 00:03:46,880 Rise. 83 00:03:48,140 --> 00:03:49,010 Like this. 84 00:03:49,280 --> 00:03:52,160 The next is jump, rise, shoot. 85 00:03:52,920 --> 00:03:54,450 So here at the jump. 86 00:03:54,450 --> 00:03:55,830 Rice shoot. 87 00:03:57,830 --> 00:03:58,430 Here as well. 88 00:03:58,430 --> 00:04:02,780 Jump, rise, shoot and only a couple more to go. 89 00:04:02,780 --> 00:04:04,160 Please stay strong. 90 00:04:04,160 --> 00:04:06,890 We have the run, so add a new one. 91 00:04:07,040 --> 00:04:07,940 Run. 92 00:04:08,800 --> 00:04:09,520 Also here. 93 00:04:09,520 --> 00:04:10,300 Player. 94 00:04:10,300 --> 00:04:11,140 Run! 95 00:04:12,670 --> 00:04:14,710 The next is the player. 96 00:04:14,860 --> 00:04:16,000 Run, shoot! 97 00:04:16,600 --> 00:04:17,769 So, uh. 98 00:04:17,769 --> 00:04:19,450 Run, shoot. 99 00:04:20,399 --> 00:04:22,019 Here we look also for run! 100 00:04:22,019 --> 00:04:22,800 Shoot. 101 00:04:24,260 --> 00:04:26,690 And we have two three more to go. 102 00:04:26,690 --> 00:04:28,190 So slide is the next one. 103 00:04:28,700 --> 00:04:29,780 Slight. 104 00:04:29,780 --> 00:04:32,000 So now yeah it didn't get selected. 105 00:04:32,000 --> 00:04:34,730 So right click rename slide. 106 00:04:35,540 --> 00:04:37,520 And here, look for a slide. 107 00:04:39,980 --> 00:04:42,380 Next up is the wall slide. 108 00:04:42,680 --> 00:04:45,470 So again a new one wall slide. 109 00:04:46,300 --> 00:04:48,910 And here we also want a poor wall slide. 110 00:04:49,870 --> 00:04:53,110 And lastly, we have the wall slide shoot. 111 00:04:54,010 --> 00:04:57,370 A wall slide shoot like this. 112 00:04:57,370 --> 00:05:00,370 And here also wall slide shoot. 113 00:05:00,520 --> 00:05:02,050 And this is it. 114 00:05:02,050 --> 00:05:04,090 Now we registered all of these here. 115 00:05:04,090 --> 00:05:05,620 It took a couple of minutes. 116 00:05:05,620 --> 00:05:08,590 This is a little bit of an annoying step in the process. 117 00:05:08,590 --> 00:05:14,620 But it is necessary because unless we register the animations here they're not going to show up in our 118 00:05:14,620 --> 00:05:15,490 animation blueprint. 119 00:05:15,490 --> 00:05:17,590 And we cannot use them with Paper XRD. 120 00:05:18,770 --> 00:05:24,530 Okay, so now that we have finished this, we can just drag it over here, make sure to save all. 121 00:05:24,530 --> 00:05:27,620 So in case something crashes, you don't have to do this again. 122 00:05:28,710 --> 00:05:31,560 The next step is creating the animation blueprint. 123 00:05:32,010 --> 00:05:36,330 So now we want to go back to the blueprints characters player. 124 00:05:36,420 --> 00:05:39,060 And you can also see the animation sequences folder. 125 00:05:39,060 --> 00:05:45,780 So when we added these animation sequences here it actually created a an asset for each of these in 126 00:05:45,780 --> 00:05:47,040 here in this folder. 127 00:05:47,040 --> 00:05:51,120 And yeah so this is just how paper Z manages these. 128 00:05:51,120 --> 00:05:53,430 So yeah we have used the animation source. 129 00:05:53,430 --> 00:05:55,410 We have been using the animation sequences. 130 00:05:55,410 --> 00:06:00,000 And the last piece of the puzzle is the animation. 131 00:06:01,030 --> 00:06:02,980 Paper Z and MBP. 132 00:06:03,550 --> 00:06:04,900 So just click it. 133 00:06:04,900 --> 00:06:08,650 And here we first have to select the parent animation source. 134 00:06:08,650 --> 00:06:13,420 And this is the as player where we just set up all of the different animation sequences so that the 135 00:06:13,420 --> 00:06:15,490 animation blueprint can access these. 136 00:06:15,490 --> 00:06:20,290 And I want to call it ABP for animation blueprint underscore player. 137 00:06:21,190 --> 00:06:22,900 And let's open it up. 138 00:06:22,900 --> 00:06:27,910 And if you've worked with animation blueprints for 3D games and skeletal meshes before, this is actually 139 00:06:27,910 --> 00:06:28,930 quite similar. 140 00:06:29,710 --> 00:06:34,000 This basically consists of the event graph where we have the tick event. 141 00:06:34,000 --> 00:06:37,960 We have the Oninit event, which we can use to set up certain references and variables. 142 00:06:37,960 --> 00:06:41,950 And here on the left side, when we double click, we also have the animation graph. 143 00:06:41,950 --> 00:06:47,350 And this lets us set up our animation trees and and decides which animation should be played at which 144 00:06:47,350 --> 00:06:47,950 time. 145 00:06:47,950 --> 00:06:51,700 But first what we want to do is on event graph on init. 146 00:06:51,700 --> 00:06:56,230 This is executed one time when this animation blueprint is initialized. 147 00:06:56,230 --> 00:07:00,580 Here we want to set up a reference to the owner which will be our player. 148 00:07:01,400 --> 00:07:06,290 Because the animation blueprint will need to know what the player and access the variables on top of 149 00:07:06,290 --> 00:07:06,980 the player. 150 00:07:07,400 --> 00:07:13,280 The way we can do this is to get owning actor and this is a special function by paper. 151 00:07:13,280 --> 00:07:18,680 ZD and here we can just cast to be player. 152 00:07:19,490 --> 00:07:20,120 Right? 153 00:07:20,120 --> 00:07:25,820 Because we of course want to access things that are on the player's parent, right? 154 00:07:25,820 --> 00:07:28,640 The action character base on the actor. 155 00:07:28,640 --> 00:07:34,490 But later on, we also want to access is shooting, for example, to know if we should hold up the gun 156 00:07:34,490 --> 00:07:34,820 or not. 157 00:07:34,820 --> 00:07:37,460 And this is only going to be available on the player. 158 00:07:37,460 --> 00:07:43,580 So this is why we need to cast to the player and not just cast to the action char base. 159 00:07:43,580 --> 00:07:48,560 And yeah, so just on init we want to do this one time and then we want to save the reference. 160 00:07:48,560 --> 00:07:53,960 So here we can drag off and just promote the variable and just call it owning player. 161 00:07:54,900 --> 00:07:56,310 Just like this. 162 00:07:56,310 --> 00:08:01,260 And this allows us to access this owning player over here in the animation graph. 163 00:08:01,260 --> 00:08:06,030 So we can look for the velocity, we can look if we're jumping or not, and do all of these things and 164 00:08:06,030 --> 00:08:08,490 decide based on that which animation we want to play. 165 00:08:08,490 --> 00:08:12,630 So just to demonstrate how this works, let's first just drag off here. 166 00:08:12,660 --> 00:08:16,890 The output animation node will determine the final state of our animation. 167 00:08:16,890 --> 00:08:21,480 We can just drag off here and type in Play Run for example. 168 00:08:21,480 --> 00:08:27,270 So if you type in play you can see all of the different, uh, you can see all of the different flipbooks 169 00:08:27,270 --> 00:08:29,490 that we registered in the animation source. 170 00:08:29,490 --> 00:08:29,970 Right. 171 00:08:29,970 --> 00:08:33,659 So let's just play run for now for demonstration purposes. 172 00:08:33,840 --> 00:08:35,460 And I'm going to compile and save. 173 00:08:35,460 --> 00:08:36,600 There's no errors. 174 00:08:36,600 --> 00:08:41,970 But if I start the game now while the character is not running, because again, we have to tell the 175 00:08:41,970 --> 00:08:45,090 player blueprint to actually use this animation blueprint. 176 00:08:45,090 --> 00:08:47,070 But this is actually very easy. 177 00:08:47,070 --> 00:08:48,780 So on the player. 178 00:08:49,750 --> 00:08:52,630 We want to look at the left and the components. 179 00:08:52,630 --> 00:08:54,880 There is the animation component. 180 00:08:54,880 --> 00:08:57,070 And this is by Paper XRD. 181 00:08:57,490 --> 00:09:02,470 When we have the selected on the right side we have the anim instance class. 182 00:09:02,470 --> 00:09:07,810 And we just have to click here and it shows up the ABP player, the animation blueprint which we just 183 00:09:07,810 --> 00:09:08,410 created. 184 00:09:08,410 --> 00:09:15,040 And this basically just tells this sprite to use this animation blueprint and creates a connection like 185 00:09:15,040 --> 00:09:15,610 that. 186 00:09:15,610 --> 00:09:21,010 Now when I go back to the map and press on play, you can see that the character is running right. 187 00:09:21,010 --> 00:09:23,560 It doesn't matter what I do, the character is always running. 188 00:09:23,560 --> 00:09:24,820 And why is that happening? 189 00:09:24,820 --> 00:09:28,390 Because I just always play run for the output animation. 190 00:09:28,390 --> 00:09:29,950 So just a very simple test. 191 00:09:29,950 --> 00:09:34,840 But this proves to us that this animation blueprint is working and the player is actually using it. 192 00:09:35,450 --> 00:09:40,100 But in the next step, we have to put in some conditions to decide should we run, should we play jumping 193 00:09:40,100 --> 00:09:40,880 or falling? 194 00:09:40,880 --> 00:09:42,950 And this is actually also quite easy. 195 00:09:43,250 --> 00:09:49,670 The simple way to do this is to just drag off here again, and we can select animation by bool like 196 00:09:49,670 --> 00:09:50,330 this. 197 00:09:50,600 --> 00:09:59,270 And we can for example just grab the owning player, get the owning player and we can get velocity all 198 00:09:59,270 --> 00:10:01,340 the way at the bottom get velocity. 199 00:10:02,090 --> 00:10:04,580 And we don't really care about the direction. 200 00:10:04,580 --> 00:10:07,070 We just want to know are we moving or not? 201 00:10:07,070 --> 00:10:10,520 And the simple way to do this is to just get vector length. 202 00:10:11,340 --> 00:10:12,870 And this will just show us. 203 00:10:12,870 --> 00:10:15,360 Are we moving or are we standing still? 204 00:10:15,360 --> 00:10:19,380 And here we just have to check for greater than zero. 205 00:10:19,380 --> 00:10:24,240 So if this is greater than zero, it means we are moving in some direction. 206 00:10:24,420 --> 00:10:26,370 So if we connect this here right. 207 00:10:26,370 --> 00:10:29,670 So true means if this is greater than zero we are moving. 208 00:10:29,670 --> 00:10:31,500 So we want to play the run animation. 209 00:10:31,500 --> 00:10:37,410 If this is smaller than zero or just zero we then want to play the idle animation right. 210 00:10:37,410 --> 00:10:38,940 So we can play idle. 211 00:10:39,610 --> 00:10:40,330 Like this. 212 00:10:40,330 --> 00:10:43,420 And we just created a simple branching logic. 213 00:10:43,420 --> 00:10:46,630 And based on this condition, it's going to decide, should we play the run animation? 214 00:10:46,630 --> 00:10:48,100 Should we play the idle animation? 215 00:10:48,130 --> 00:10:49,690 Let's try this out. 216 00:10:50,020 --> 00:10:50,320 Right. 217 00:10:50,320 --> 00:10:51,310 So I'm just standing still. 218 00:10:51,310 --> 00:10:52,570 I don't have any velocity. 219 00:10:52,570 --> 00:10:53,560 I'm just standing. 220 00:10:53,560 --> 00:10:59,410 But I start moving and hey, we start walking around, you can see the animation and it is actually 221 00:10:59,410 --> 00:11:00,460 that simple. 222 00:11:01,140 --> 00:11:06,180 But as you keep on adding more and more functionality, it actually gets quite messy if you just use 223 00:11:06,180 --> 00:11:07,650 these selects, right? 224 00:11:07,650 --> 00:11:12,570 Because for example, we can if we are running well, if we are moving, we could also be jumping or 225 00:11:12,570 --> 00:11:13,260 falling, right? 226 00:11:13,260 --> 00:11:16,440 So then we would have to use another select anim by bool. 227 00:11:16,440 --> 00:11:18,810 And then we would have to decide are we airborne or not. 228 00:11:18,810 --> 00:11:21,030 And then if we're not airborne okay we can play run. 229 00:11:21,030 --> 00:11:26,370 But if we're airborne then again we have to select anim by bool and then decide are we falling or are 230 00:11:26,370 --> 00:11:27,480 we going upward. 231 00:11:27,480 --> 00:11:30,300 And you can see that this becomes quite messy. 232 00:11:30,300 --> 00:11:33,570 And there's actually a better way of going about this. 233 00:11:33,570 --> 00:11:35,460 So we can just delete all of this. 234 00:11:35,990 --> 00:11:39,800 And right click and create a state machine. 235 00:11:39,800 --> 00:11:41,990 Right add new state machine. 236 00:11:42,230 --> 00:11:47,810 And I like to call this locomotion for the basic movement and just connect it here. 237 00:11:47,810 --> 00:11:49,730 And you can have multiple state machines. 238 00:11:49,730 --> 00:11:53,480 You can then use the select by bool between different state machines. 239 00:11:53,480 --> 00:11:58,160 So you could have a state machine for swimming for example, one for flying and so on. 240 00:11:58,160 --> 00:12:00,080 And then connect them here. 241 00:12:00,080 --> 00:12:01,520 But we just have a simple character. 242 00:12:01,520 --> 00:12:05,090 So in here we now have a kind of different type of graph. 243 00:12:05,090 --> 00:12:07,220 And this is just the starting point. 244 00:12:07,340 --> 00:12:10,100 And our starting point should always be the idle animation. 245 00:12:10,100 --> 00:12:10,370 Right. 246 00:12:10,370 --> 00:12:15,440 So we can drag off here and animation state and we want to rename this. 247 00:12:15,440 --> 00:12:19,820 So just right click and rename or just hit F2. 248 00:12:19,820 --> 00:12:21,770 And I'm going to call this idle. 249 00:12:22,920 --> 00:12:24,600 But this alone doesn't do anything. 250 00:12:24,600 --> 00:12:25,710 We have to double click it. 251 00:12:25,710 --> 00:12:28,980 And in here we again have this output for the animation. 252 00:12:28,980 --> 00:12:32,010 And here we just want to play idle. 253 00:12:34,380 --> 00:12:35,640 Just like this, right? 254 00:12:35,640 --> 00:12:37,350 And then we can go back here. 255 00:12:37,350 --> 00:12:37,800 Right? 256 00:12:37,800 --> 00:12:39,180 Go back to locomotion. 257 00:12:39,180 --> 00:12:41,610 And I'm also going to use the mouse buttons. 258 00:12:41,610 --> 00:12:46,140 So if you have thumb buttons on your mouse you can use them to go back and forward here, which is very 259 00:12:46,140 --> 00:12:46,920 useful. 260 00:12:46,920 --> 00:12:48,960 But yeah just go back to locomotion. 261 00:12:48,960 --> 00:12:49,230 Right. 262 00:12:49,230 --> 00:12:52,380 So we start here, we go into idle and that's it. 263 00:12:52,710 --> 00:12:56,670 But now we also want to put in again the transition to run. 264 00:12:58,030 --> 00:12:58,630 Like this. 265 00:12:58,630 --> 00:13:01,630 And if we can run well, we just want to play run. 266 00:13:01,630 --> 00:13:02,680 Very simple. 267 00:13:04,040 --> 00:13:05,990 And we need to put in the condition. 268 00:13:05,990 --> 00:13:11,180 So this condition is going to decide are we allowed to go from idle to run, or are we just going to 269 00:13:11,180 --> 00:13:12,290 be stuck in idle. 270 00:13:12,290 --> 00:13:14,960 So here we again want to do the same thing we did before. 271 00:13:14,960 --> 00:13:19,160 This looks a little bit different and we just have a result that is either true or false. 272 00:13:19,160 --> 00:13:24,650 But again we get the owning player, get velocity all the way at the bottom. 273 00:13:25,420 --> 00:13:29,650 Then we can get vector length actually just a vector length. 274 00:13:29,650 --> 00:13:30,610 Just type that in. 275 00:13:31,450 --> 00:13:35,920 And again, we just want to decide bigger than zero. 276 00:13:36,100 --> 00:13:37,750 And this is our condition. 277 00:13:37,750 --> 00:13:42,010 So if this is true we are allowed to go from idle to run. 278 00:13:42,010 --> 00:13:45,340 So let's just try this out I go here, I'm an idle. 279 00:13:45,340 --> 00:13:46,300 It's all good. 280 00:13:46,570 --> 00:13:48,700 I add velocity by walking. 281 00:13:48,700 --> 00:13:49,630 I'm walking. 282 00:13:49,630 --> 00:13:52,000 But now I just keep on walking. 283 00:13:52,000 --> 00:13:58,840 We actually also need to add a condition for going back from run to idle, so we can just drag off here. 284 00:13:58,930 --> 00:14:01,240 And the easiest way is to just go here. 285 00:14:01,240 --> 00:14:08,710 We can just copy all of this control C go back here and paste control V and just add the not boolean 286 00:14:08,710 --> 00:14:09,250 here. 287 00:14:10,190 --> 00:14:11,210 And just connect it here. 288 00:14:11,210 --> 00:14:15,440 So this is the exact opposite of the case we have here. 289 00:14:15,440 --> 00:14:17,390 I can compile save go in here. 290 00:14:17,390 --> 00:14:20,000 And yeah I can walk I can stand still. 291 00:14:20,420 --> 00:14:23,630 And we basically just do the same thing we did before with the select. 292 00:14:23,630 --> 00:14:26,450 But this is much more maintainable and expandable. 293 00:14:27,330 --> 00:14:31,410 And this is the stage where you sometimes notice that the setting might be wrong. 294 00:14:31,410 --> 00:14:35,430 And I think for the idle animation, it looks a little bit too busy and too fast. 295 00:14:35,430 --> 00:14:42,450 So we can just quickly slow this down in the content drawer, go to Paper Assets Character Player, 296 00:14:42,450 --> 00:14:46,890 and we have the idle here, the player idle. 297 00:14:46,890 --> 00:14:52,470 And I actually want to change this to five from seven to slow it down a little bit, make it a little 298 00:14:52,470 --> 00:14:53,790 bit more relaxed. 299 00:14:54,300 --> 00:14:58,050 And yeah, you can see that this works out now it's a little bit slower. 300 00:14:58,800 --> 00:15:01,950 And these are the kind of things you just adjust while you make the game. 301 00:15:02,220 --> 00:15:08,430 Next up is the jumping and falling animation, and we can easily add this again in our ABP player. 302 00:15:09,300 --> 00:15:10,170 From the idol. 303 00:15:10,170 --> 00:15:16,020 We just want to drag upward animation state and rename it to Jump Rise. 304 00:15:16,050 --> 00:15:20,040 This is the animation that's going to play while we're jumping and ascending. 305 00:15:20,040 --> 00:15:21,240 So just open it up. 306 00:15:21,240 --> 00:15:23,070 And here just play. 307 00:15:23,070 --> 00:15:25,350 Jump rise like this. 308 00:15:26,530 --> 00:15:28,780 And we then just want to set up the condition here. 309 00:15:28,780 --> 00:15:36,670 So from the owning player we can get owning player and we can just get is falling like this from the 310 00:15:36,670 --> 00:15:37,600 character movement. 311 00:15:37,600 --> 00:15:45,070 And is falling is actually named a little bit confusing because is falling actually just means is airborne. 312 00:15:45,070 --> 00:15:50,080 So this also is true if we are jumping upwards, which we want to do here. 313 00:15:50,080 --> 00:15:51,340 So we can just connect it here. 314 00:15:52,720 --> 00:15:56,590 And this is enough to go from idle to jump rice so I can go here. 315 00:15:56,830 --> 00:16:00,460 I just jump while being idle and you can see we play the animation. 316 00:16:00,460 --> 00:16:03,220 But again, now we're stuck in the animation forever. 317 00:16:04,140 --> 00:16:05,910 And we want to. 318 00:16:07,620 --> 00:16:11,460 Actually go from the jump race animation into the falling animation first. 319 00:16:13,860 --> 00:16:16,140 So here we have another animation state. 320 00:16:16,320 --> 00:16:18,450 Just rename it to fall. 321 00:16:18,450 --> 00:16:21,960 And here we just want to play fall. 322 00:16:22,650 --> 00:16:23,790 Just like this. 323 00:16:27,510 --> 00:16:29,940 And the condition here is a little bit different. 324 00:16:31,270 --> 00:16:38,020 Here, we simply want to check for the get owning player and we want to get the velocity. 325 00:16:39,690 --> 00:16:40,980 All the way at the bottom again. 326 00:16:40,980 --> 00:16:43,920 And this time we actually care about the direction. 327 00:16:43,920 --> 00:16:47,130 So we can split right click split struct pin. 328 00:16:47,130 --> 00:16:51,120 We only care about the z because z is going up and down. 329 00:16:51,120 --> 00:16:57,600 And well, we want to know if the z is smaller or equal then zero right. 330 00:16:57,600 --> 00:17:03,780 So if this is smaller, equal and zero this means we are done ascending and we're going to start descending, 331 00:17:03,780 --> 00:17:07,829 which is exactly when we want to go from our jump rise to the fall. 332 00:17:07,829 --> 00:17:09,030 So let's check this out. 333 00:17:09,859 --> 00:17:13,520 Yeah, we go up and once we hit the apex, we go down. 334 00:17:13,520 --> 00:17:18,470 But now again, we want to finish this and go from fall back to idle. 335 00:17:20,280 --> 00:17:23,490 And for this condition, we can just go here from the idle to jump rice. 336 00:17:23,490 --> 00:17:24,569 Copy all of this. 337 00:17:24,569 --> 00:17:25,650 The is falling. 338 00:17:25,650 --> 00:17:33,720 Ctrl c go in here Ctrl V and here we just again just use the not boolean to exactly flip it around. 339 00:17:33,750 --> 00:17:39,360 So this means if we are not falling anymore well we can go from the jump rice to the fall then from 340 00:17:39,360 --> 00:17:40,950 the fall back to the idle. 341 00:17:40,950 --> 00:17:42,240 So like this. 342 00:17:43,010 --> 00:17:43,490 Yeah. 343 00:17:43,490 --> 00:17:44,870 So we have this loop set up. 344 00:17:44,870 --> 00:17:50,900 But there is one issue that is if we jump while we are walking, we are actually not playing the animation 345 00:17:51,230 --> 00:17:57,380 because we did not set up a transition from running into jump rice only from idle. 346 00:17:57,380 --> 00:17:58,700 So let's do that now. 347 00:17:58,700 --> 00:18:02,090 Let's create some space to make it easier to see and connect here. 348 00:18:02,090 --> 00:18:05,120 And here we just have the same condition from idle to jump rice. 349 00:18:05,120 --> 00:18:06,740 Just copy this ctrl c. 350 00:18:06,980 --> 00:18:10,250 And now it can be a little bit confusing which one is which. 351 00:18:10,250 --> 00:18:14,360 But if you just hover you can see a run to jump rice which is the one we want. 352 00:18:15,080 --> 00:18:19,040 Just go here and put it in here and connect it. 353 00:18:19,650 --> 00:18:20,130 Yeah. 354 00:18:20,130 --> 00:18:25,170 So if we start falling or are airborne, we can also go from jump. 355 00:18:25,170 --> 00:18:27,360 We can also go from run to jump rise. 356 00:18:27,570 --> 00:18:28,500 So let's go here. 357 00:18:29,060 --> 00:18:31,010 I am running and I jump. 358 00:18:31,010 --> 00:18:32,330 Yes, we go to jump rice. 359 00:18:32,330 --> 00:18:33,320 We go to falling. 360 00:18:33,320 --> 00:18:34,310 This is fine. 361 00:18:34,310 --> 00:18:35,600 While idle, it's fine. 362 00:18:35,600 --> 00:18:40,640 So this is how we set up all of the different animations and the shooting and the sliding. 363 00:18:40,640 --> 00:18:42,260 Everything else we're going to take care of later. 364 00:18:42,260 --> 00:18:46,670 But this is the basic setup you're probably going to use again and again for all of your games. 365 00:18:47,410 --> 00:18:52,360 But the thing that bothers me a lot right now is that the character is not fun to control at all. 366 00:18:52,360 --> 00:18:53,620 It is super floaty. 367 00:18:53,650 --> 00:18:55,510 We don't have any control over the movement. 368 00:18:55,510 --> 00:18:58,570 It's just kind of keeps drifting in certain directions. 369 00:18:58,570 --> 00:19:03,220 And this is because the default settings on the character movement component are really bad. 370 00:19:03,220 --> 00:19:05,830 And in the next lesson, we're going to take care of that. 31603

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