﻿1
00:00:04,790 --> 00:00:05,600
‫Hello and welcome.

2
00:00:05,600 --> 00:00:11,420
‫In this lecture, we're going to be introducing you to animations, how we can use the same animations

3
00:00:11,420 --> 00:00:14,540
‫on multiple different types of meshes using something called a skeleton.

4
00:00:14,540 --> 00:00:17,240
‫Let's dive in and see what all that's about.

5
00:00:18,190 --> 00:00:24,430
‫So as I said at the end of last lecture, this is looking weird without any sort of animation.

6
00:00:24,430 --> 00:00:28,480
‫So it's time to do a 101 on animations.

7
00:00:28,660 --> 00:00:33,450
‫The first thing to do is to see if we can find some animations in an asset pack.

8
00:00:33,460 --> 00:00:37,180
‫An easy way to do this is using the filters in the content browsers, which you've probably come across

9
00:00:37,180 --> 00:00:37,840
‫before.

10
00:00:37,900 --> 00:00:42,590
‫You can filter by all sorts of stuff here, and one of them is the all animation assets.

11
00:00:42,590 --> 00:00:47,140
‫And just going to go ahead and check that is it adds in all of the animation assets and you can see

12
00:00:47,140 --> 00:00:48,480
‫there is a bunch of stuff in here.

13
00:00:48,490 --> 00:00:53,680
‫We're particularly looking for the green ones because these are basic animation sequences, as they're

14
00:00:53,680 --> 00:00:54,250
‫called.

15
00:00:54,280 --> 00:00:59,620
‫We can go ahead and double click on one of those and you can see it automatically starts playing in

16
00:00:59,620 --> 00:01:00,400
‫the animation.

17
00:01:00,400 --> 00:01:06,040
‫Editor There's a lot going on here and the animation editor But the main thing to see is this timeline.

18
00:01:06,040 --> 00:01:07,420
‫That's the main difference.

19
00:01:07,630 --> 00:01:11,500
‫We've also got the asset details, which is a details pane.

20
00:01:11,500 --> 00:01:12,970
‫We've seen that sort of stuff before.

21
00:01:13,430 --> 00:01:16,900
‫There's also this stuff up at the top, right, which we're going to dive into in just a second.

22
00:01:17,440 --> 00:01:23,380
‫But the main thing to look out for is the fact it's looping through this timeline, which you can go

23
00:01:23,380 --> 00:01:24,580
‫ahead and grab pointer.

24
00:01:24,580 --> 00:01:29,080
‫Any keyframe in this timeline, if you like, you can play it forwards, you can play it backwards as

25
00:01:29,080 --> 00:01:30,070
‫your heart desires.

26
00:01:30,070 --> 00:01:32,110
‫You can step through frame by frame.

27
00:01:32,350 --> 00:01:37,570
‫You can also use this asset browser over in the bottom right, and that asset browser just allows you

28
00:01:37,570 --> 00:01:41,290
‫to search through all of the animations related to the skeleton.

29
00:01:41,290 --> 00:01:44,200
‫Now I just used the word you probably don't know a skeleton.

30
00:01:44,200 --> 00:01:44,870
‫What is it?

31
00:01:44,890 --> 00:01:47,260
‫Well, we're dealing with a skeletal mesh.

32
00:01:47,260 --> 00:01:48,190
‫Animations.

33
00:01:48,190 --> 00:01:48,910
‫What is that?

34
00:01:48,910 --> 00:01:51,820
‫That's a mesh that has, well, a skeleton.

35
00:01:51,820 --> 00:01:56,560
‫It's a mesh that you want to manipulate through a bunch of bones.

36
00:01:56,560 --> 00:02:02,320
‫So if we click up here in the top, right on the skeleton, you can see that this guy is in an A pose.

37
00:02:02,350 --> 00:02:06,880
‫He is a mesh, but then he's got a bunch of different bones here.

38
00:02:06,880 --> 00:02:11,290
‫We can select any one of these bones and we could do something like rotate it.

39
00:02:11,290 --> 00:02:15,150
‫And you can see that that one wasn't a particularly useful one to select.

40
00:02:15,160 --> 00:02:22,690
‫Maybe if I select with my mouse, the spine and I rotate the spine, you can see how that changes the

41
00:02:22,690 --> 00:02:25,600
‫rest of the mesh based on changing the spine.

42
00:02:26,170 --> 00:02:27,010
‫So great.

43
00:02:27,010 --> 00:02:30,610
‫That's kind of what a skeleton is, but that's not all.

44
00:02:31,150 --> 00:02:35,920
‫The skeleton kind of exists within the modeling program that was creating this mesh.

45
00:02:35,920 --> 00:02:39,160
‫But a skeleton Unreal has a slightly different function.

46
00:02:39,160 --> 00:02:46,840
‫So this skeleton asset here, its main function, is to tie together the meshes and animations.

47
00:02:46,840 --> 00:02:54,070
‫You can have multiple meshes, which all use the same skeleton asset in Unreal and set multiple animations

48
00:02:54,070 --> 00:02:55,330
‫that use the same skeleton.

49
00:02:55,330 --> 00:03:00,020
‫And because of that, we can share those animation assets between different meshes.

50
00:03:00,040 --> 00:03:05,140
‫The example here is the there are a couple of different Wraith meshes that I've included different skins

51
00:03:05,140 --> 00:03:10,660
‫on that Wraith mesh, and some of them have extra bits and bobs on the mesh, but they can all use the

52
00:03:10,660 --> 00:03:14,950
‫same animations because those animations are based on a skeleton that they all share.

53
00:03:15,370 --> 00:03:19,690
‫So that's why we have this a little UI setup widget in the top, right?

54
00:03:19,690 --> 00:03:21,640
‫We won't look at the blueprints just now.

55
00:03:21,640 --> 00:03:26,890
‫That's another asset that depends upon the skeleton, but not one that we're currently interested in.

56
00:03:26,890 --> 00:03:30,520
‫So the skeleton is what hangs all of this together, brings it all together.

57
00:03:30,520 --> 00:03:35,620
‫They all depend upon that same skeleton, which means that this dropdown allows us to choose between

58
00:03:35,620 --> 00:03:38,230
‫different meshes that use this skeleton.

59
00:03:38,230 --> 00:03:44,320
‫And the dropdown next to animation allows us to choose different animations that rely upon this same

60
00:03:44,320 --> 00:03:44,830
‫skeleton.

61
00:03:44,830 --> 00:03:47,500
‫So I can go and swap out to a different animation.

62
00:03:47,500 --> 00:03:50,710
‫I can swap out to a different mesh if I so choose.

63
00:03:50,710 --> 00:03:52,150
‫And you can see how that mesh is different.

64
00:03:52,150 --> 00:03:53,320
‫It's got different spiky bits.

65
00:03:53,320 --> 00:03:55,030
‫It's got different textures on it.

66
00:03:56,160 --> 00:03:58,740
‫So let's try out a challenge.

67
00:03:59,310 --> 00:04:05,970
‫Let's see if we can find a suitable running animation that we can play just on a continuous loop.

68
00:04:05,970 --> 00:04:07,830
‫At the moment, it'll look a little bit weird in the game.

69
00:04:08,130 --> 00:04:11,890
‫Less weird than a guy running around in an oppose.

70
00:04:11,910 --> 00:04:18,090
‫So look through the available animations using either the content browser or that browser.

71
00:04:18,090 --> 00:04:22,320
‫Inside the animations editor set one for the Wraith character.

72
00:04:22,320 --> 00:04:26,670
‫So go into our BP character that we've already created.

73
00:04:26,670 --> 00:04:30,810
‫Go and find the mesh and see if you can find a way of setting the animation.

74
00:04:30,810 --> 00:04:31,710
‫A little bit of a challenge there.

75
00:04:31,710 --> 00:04:36,450
‫I haven't shown you how to do it, but see if you can find the right property for setting an animation

76
00:04:36,720 --> 00:04:42,930
‫and then try swapping the Wraith character for a different mesh that has the same skeleton and see if

77
00:04:42,930 --> 00:04:44,200
‫that continues to work.

78
00:04:44,220 --> 00:04:45,900
‫Pause the video and have a go.

79
00:04:47,000 --> 00:04:47,240
‫Okay.

80
00:04:47,240 --> 00:04:47,830
‫Welcome back.

81
00:04:47,840 --> 00:04:48,810
‫So let's see.

82
00:04:48,830 --> 00:04:54,380
‫First of all, I need to find a run animation, so I'm going to do this via the asset browser.

83
00:04:54,380 --> 00:04:59,270
‫In this editor, you could do it by either searching it through the asset browser or doing the dropdown

84
00:04:59,270 --> 00:05:01,220
‫on the animations and searching there.

85
00:05:01,220 --> 00:05:07,610
‫I'm going to look for run and interestingly enough, doesn't come up with anything automatically there.

86
00:05:07,610 --> 00:05:11,000
‫So I'm going to search in the asset browser run not coming up.

87
00:05:11,000 --> 00:05:14,030
‫Let's see, maybe there's a walk.

88
00:05:14,270 --> 00:05:15,680
‫Let's see ability.

89
00:05:16,010 --> 00:05:17,300
‫Let's see this one.

90
00:05:17,300 --> 00:05:20,390
‫Maybe that's with the right mouse button held down.

91
00:05:20,390 --> 00:05:21,710
‫So he's aiming.

92
00:05:21,740 --> 00:05:23,330
‫That's probably a good one to start off with.

93
00:05:23,330 --> 00:05:27,140
‫We want the forward one so we're going to hit play forward.

94
00:05:27,170 --> 00:05:30,230
‫There's one for backwards left right.

95
00:05:30,230 --> 00:05:33,170
‫You can see how this stuff is going to start slotting together.

96
00:05:33,590 --> 00:05:36,680
‫Right now we're just doing a101 on skeletal animation.

97
00:05:36,680 --> 00:05:44,510
‫So let's use this ability are be walk forward and let's go and find ourselves.

98
00:05:44,510 --> 00:05:50,150
‫First of all, I'm going to cancel out this filter for animations, going to go and select our shooter

99
00:05:50,150 --> 00:05:58,100
‫character and open up that blueprint, go to the mesh in the components hierarchy and then select the

100
00:05:58,130 --> 00:05:58,970
‫in the details pane.

101
00:05:58,970 --> 00:06:04,160
‫Down in the mesh setting, we've got different skeletal meshes that we could swap out.

102
00:06:04,160 --> 00:06:10,160
‫And just to clarify, the skeletal meshes are the ones that have skeletons, the ones that are able

103
00:06:10,160 --> 00:06:15,110
‫to deform themselves with a skeleton, whereas static meshes are the ones that can't deform the cells

104
00:06:15,110 --> 00:06:17,720
‫usually used for rigid things like cars.

105
00:06:17,900 --> 00:06:20,390
‫So in the section above this we have animation.

106
00:06:20,390 --> 00:06:23,660
‫You can see this animation mode and animate class.

107
00:06:23,660 --> 00:06:28,160
‫So we'd have to do a drop down on the animation mode if you had figured that out.

108
00:06:28,160 --> 00:06:31,460
‫Don't worry if you didn't, but it was good to have a little look around.

109
00:06:31,460 --> 00:06:39,270
‫Then you can see we can use animation asset in here and we can swap that animation asset out for what

110
00:06:39,270 --> 00:06:45,860
‫was it, r, m b and then underscore walk, I believe there we go, walk forward.

111
00:06:45,860 --> 00:06:47,690
‫And that's going to be on looping.

112
00:06:47,690 --> 00:06:51,350
‫We're going to play it initially from the initial position of zero.

113
00:06:51,350 --> 00:06:52,520
‫Let's try that out.

114
00:06:52,520 --> 00:06:58,670
‫If we go to the viewport, you can see he's already doing that walking animation so I can go ahead and

115
00:06:58,670 --> 00:07:03,080
‫play and he's going to be walking in my game as well.

116
00:07:03,080 --> 00:07:07,250
‫And as long as I'm moving forward, that all looks hunky dory.

117
00:07:07,250 --> 00:07:11,960
‫But as soon as I start moving backwards and sideways, it all falls apart.

118
00:07:11,960 --> 00:07:13,340
‫We're going to fix that, don't worry.

119
00:07:13,340 --> 00:07:16,070
‫But for starters, we've figured out how to do this.

120
00:07:16,550 --> 00:07:20,060
‫The other thing we need to do is try with a different mesh.

121
00:07:20,060 --> 00:07:23,180
‫So we've done it with the basic Wraith mesh.

122
00:07:23,180 --> 00:07:28,070
‫There are other meshes in here, but they're not going to work because they're not based off the same

123
00:07:28,070 --> 00:07:29,360
‫skeleton as the animation.

124
00:07:29,360 --> 00:07:32,180
‫In fact, you can see it unselected the animation to play.

125
00:07:32,180 --> 00:07:41,690
‫So if we go back to our mesh and change that out for the Wraith skeletal mesh, then go to our anim

126
00:07:41,690 --> 00:07:43,220
‫and look for the walk again.

127
00:07:43,760 --> 00:07:50,720
‫Walk forward, then swap out a mesh for one that has a compatible skeleton such as the Luna ops skeleton.

128
00:07:50,720 --> 00:07:56,660
‫You can see it hasn't removed the animation because they share a skeleton, so they are compatible with

129
00:07:56,660 --> 00:07:57,530
‫one another.

130
00:07:58,480 --> 00:07:59,020
‫Awesome stuff.

131
00:07:59,020 --> 00:08:04,750
‫So now hopefully you understand a little bit more about what an animation is, how you're able to play

132
00:08:04,750 --> 00:08:09,070
‫it, and how it relates to skeletons and to skeletal meshes.

133
00:08:09,710 --> 00:08:15,440
‫Next video will be a brief interlude on how to fix a little collision bug that we you may have seen

134
00:08:15,440 --> 00:08:17,840
‫just glitching in the background there.

135
00:08:17,840 --> 00:08:19,220
‫So I'll see you there.

