﻿1
00:00:04,310 --> 00:00:05,000
‫Hello and welcome.

2
00:00:05,010 --> 00:00:10,220
‫In this lecture, we're going to be looking at hooking up our character movement so that we can move

3
00:00:10,220 --> 00:00:13,310
‫forward strife and look around our world.

4
00:00:13,310 --> 00:00:17,960
‫The classics of moving around in a first person or third person shooter.

5
00:00:17,960 --> 00:00:19,400
‫Let's dive in and see how it's done.

6
00:00:20,390 --> 00:00:26,420
‫So continuing along in the vein of trying to get our character movement working, we are first of all

7
00:00:26,420 --> 00:00:32,000
‫going to want to bind some input, but we're also going to know want to know what to bind that input

8
00:00:32,000 --> 00:00:32,750
‫to.

9
00:00:32,930 --> 00:00:38,060
‫Fortunately, when it comes to characters, there's a lot of simplifying stuff going on for us.

10
00:00:38,060 --> 00:00:43,760
‫After all, Unreal really is an engine that's optimized for making things like shooter games, character

11
00:00:43,760 --> 00:00:44,390
‫games.

12
00:00:44,390 --> 00:00:52,100
‫And let's have a look at some of the movement functions that are already provided for us by the character

13
00:00:52,100 --> 00:00:57,650
‫actor class, not just the character movement component, but also the character actor class provides

14
00:00:57,650 --> 00:01:02,480
‫these and often passes a lot of this on to the character movement component, but not necessarily so.

15
00:01:02,480 --> 00:01:04,940
‫Let's see what movement functions we're going to be dealing with.

16
00:01:04,940 --> 00:01:08,480
‫First of all, there is going to be add movement input.

17
00:01:08,510 --> 00:01:12,830
‫Add movement input basically takes a vector and tells you which direction you're going to move in.

18
00:01:12,830 --> 00:01:14,660
‫So if it's a forward vector, you move forward.

19
00:01:14,660 --> 00:01:16,250
‫If it's a backwards vector, you move backwards.

20
00:01:16,250 --> 00:01:18,650
‫If it's a right vector, you move right and so on.

21
00:01:18,650 --> 00:01:22,580
‫And the size of the vector is going to determine how fast you move in that direction.

22
00:01:23,000 --> 00:01:27,500
‫The next thing is we've got add controller pitch input.

23
00:01:27,500 --> 00:01:32,090
‫So that's about looking up and down, which is obviously very useful.

24
00:01:32,090 --> 00:01:35,540
‫When you've got your mouse, you want to be looking up and down by moving your mouse up and down.

25
00:01:35,960 --> 00:01:39,980
‫Then there's add controller, your input which is going left and right.

26
00:01:40,400 --> 00:01:45,080
‫And finally there is a jump function which is just that maybe you hit the spacebar and you jump.

27
00:01:45,320 --> 00:01:52,220
‫So with these things in mind, what we want to go ahead and do is create some bindings in our character

28
00:01:52,220 --> 00:01:55,850
‫actor class that bind some input.

29
00:01:55,860 --> 00:02:01,700
‫So some inputs from your keyboard, your mouse, your controller to these functions.

30
00:02:01,700 --> 00:02:05,510
‫So we're going to do a few and then we're going to do a challenge to do the rest.

31
00:02:05,810 --> 00:02:11,120
‫So let's go over to Visual Studio code and I'm in my shooter character.

32
00:02:11,450 --> 00:02:18,560
‫H and we notice that we've got already here the set up player input component function.

33
00:02:18,560 --> 00:02:20,900
‫This is where we need to bind our input.

34
00:02:21,020 --> 00:02:24,560
‫Going to hit F12 to go over to the C++.

35
00:02:25,750 --> 00:02:31,900
‫I'm going to hit Alt oh to go over to the C++ and find where we've got that set up.

36
00:02:31,900 --> 00:02:36,570
‫So the first thing is it gives us this input component that we want to bind with.

37
00:02:36,580 --> 00:02:38,410
‫If you remember, this is the way we do it.

38
00:02:38,410 --> 00:02:45,490
‫We have a player input component, we use the arrow operator and we then do a bind function here.

39
00:02:45,490 --> 00:02:53,650
‫So it's either a bind access or it's going to be a bind action depending on whether it's a discrete

40
00:02:53,650 --> 00:03:01,300
‫action such as jump or whether it is an action that has a value such as looking up and down or moving.

41
00:03:01,660 --> 00:03:08,860
‫Now, even when we do movement with a key, we still tend to bind it using an axis.

42
00:03:08,860 --> 00:03:14,230
‫So I'm actually going to be making a bit of a typo for the first part of this video.

43
00:03:14,230 --> 00:03:19,990
‫I will correct it later on, but do go ahead and use the bind axis instead of bind action here.

44
00:03:20,840 --> 00:03:29,000
‫So really to take a step even further back, we need to go ahead and set up these actions and axes in

45
00:03:29,000 --> 00:03:29,950
‫our project settings.

46
00:03:29,960 --> 00:03:32,120
‫So let's go back over into Unreal.

47
00:03:32,150 --> 00:03:38,150
‫Go to settings, project settings, and then I'm going to dock this down so we can see it very clearly

48
00:03:38,240 --> 00:03:42,020
‫and we're going to go to the input section.

49
00:03:42,020 --> 00:03:48,770
‫So engine input and set up some axes mappings and some action mappings.

50
00:03:50,590 --> 00:03:56,800
‫So the ones I'm going to deal with right off the bat are the axes mappings for we're going to have,

51
00:03:56,800 --> 00:03:59,290
‫first of all, a move forward.

52
00:04:00,230 --> 00:04:04,490
‫And we're going to have also a look up.

53
00:04:04,520 --> 00:04:10,370
‫Now, remember, we don't have a move forward and a move backwards because we can just do that with

54
00:04:10,370 --> 00:04:11,630
‫negative scale.

55
00:04:11,780 --> 00:04:17,060
‫So, for example, I want to set up my W Quay to be my move forward.

56
00:04:17,060 --> 00:04:18,650
‫So that is scale one.

57
00:04:18,650 --> 00:04:25,250
‫But if I want my se key to be my move back, I can still use move forward, but give it the scale of

58
00:04:25,250 --> 00:04:25,940
‫minus one.

59
00:04:25,940 --> 00:04:27,240
‫Just a quick reminder for you.

60
00:04:27,260 --> 00:04:28,430
‫Same with look up.

61
00:04:28,430 --> 00:04:30,020
‫I'm going to be using the mouse for this.

62
00:04:30,020 --> 00:04:33,110
‫We'll cover controller input in the next lecture.

63
00:04:33,200 --> 00:04:35,620
‫We're going to use the mouse y.

64
00:04:35,630 --> 00:04:41,030
‫Now, remember, y is the one that goes up and down rather than left and right because it's kind of

65
00:04:41,030 --> 00:04:42,080
‫a bit taller, isn't it?

66
00:04:42,080 --> 00:04:44,570
‫A Y is a little bit of a taller letter than an X.

67
00:04:44,570 --> 00:04:45,950
‫That's how I remember it anyway.

68
00:04:45,950 --> 00:04:52,130
‫So Mouse Y is up and down and then we'll have to tweak with the scale, see whether it's going in the

69
00:04:52,130 --> 00:04:53,090
‫right direction.

70
00:04:53,090 --> 00:04:57,620
‫But basically this will give us negative values if we're going down and positive values if we're going

71
00:04:57,620 --> 00:04:58,070
‫up.

72
00:04:58,070 --> 00:05:02,900
‫So we may need to tweak with look up to see whether this is going to go in the right direction.

73
00:05:02,900 --> 00:05:09,230
‫But you get the idea we can either invert the scale or not, depending on the type of input that's coming

74
00:05:09,230 --> 00:05:09,800
‫in here.

75
00:05:10,950 --> 00:05:14,390
‫So once we got the axis name, we can go back into the C++.

76
00:05:14,400 --> 00:05:19,590
‫We're going to bind it using the text macro and the text of the axis name.

77
00:05:19,710 --> 00:05:25,180
‫Then we need to say who we're going to call the function on and what function we're going to call.

78
00:05:25,200 --> 00:05:31,290
‫We currently don't have a function that we want to call, so I'm going to go and create a new private

79
00:05:31,290 --> 00:05:35,160
‫function over in my C++ header file.

80
00:05:35,280 --> 00:05:41,220
‫And it is going to be a void function that is going to be called move forward.

81
00:05:42,320 --> 00:05:46,130
‫And it's going to take the float, which is going to be the axis value.

82
00:05:49,380 --> 00:05:50,880
‫Finish off with a semi-colon.

83
00:05:50,880 --> 00:05:55,320
‫And I've got a little trick, a little extension here that helps me implement these things a little

84
00:05:55,320 --> 00:05:58,380
‫bit quicker by doing control shift p and.

85
00:06:00,460 --> 00:06:06,640
‫If I type in create implementation, it goes ahead and creates that implementation for me in the C++

86
00:06:06,640 --> 00:06:06,940
‫file.

87
00:06:06,940 --> 00:06:08,060
‫Really nice and easy.

88
00:06:08,080 --> 00:06:09,460
‫The name of that extension.

89
00:06:09,460 --> 00:06:14,470
‫If I go over, I always forget the names of my extensions, so I'll go and have a look for what it might

90
00:06:14,470 --> 00:06:14,980
‫be.

91
00:06:15,820 --> 00:06:18,310
‫Yes, it's this little doozy here, the C++ helper.

92
00:06:18,310 --> 00:06:24,160
‫If you go ahead and install this one for your VTS code, it just allows you to do that sort of thing,

93
00:06:24,160 --> 00:06:25,090
‫which is very nice.

94
00:06:25,090 --> 00:06:25,810
‫Very handy.

95
00:06:27,490 --> 00:06:30,060
‫So this is the function that we want to set it up to call.

96
00:06:30,070 --> 00:06:32,850
‫So first of all, we say this, this is the target.

97
00:06:32,860 --> 00:06:36,390
‫The current object is the target for this function.

98
00:06:36,400 --> 00:06:42,850
‫Then we go ahead and put in the issue to the fully qualified function issue, to character, colon,

99
00:06:42,850 --> 00:06:46,990
‫colon move forward and that should bind us to this function.

100
00:06:47,530 --> 00:06:54,460
‫And then finally, what we want to do is pass that axis value on to the function that we actually want

101
00:06:54,460 --> 00:06:57,430
‫to call, which is a parent function.

102
00:06:57,430 --> 00:06:58,600
‫So we don't have to do anything.

103
00:06:58,600 --> 00:07:01,660
‫We can just do ad movement.

104
00:07:12,480 --> 00:07:13,680
‫Input like so.

105
00:07:14,320 --> 00:07:20,640
‫So because this is the move forward method, we want to have the forward vector of the actor.

106
00:07:20,650 --> 00:07:28,990
‫So the way we do that is we can do a get actor forward vector like so and then we want it to be forward

107
00:07:28,990 --> 00:07:34,090
‫in the amount that our access value gives us so we can multiply by the axis value.

108
00:07:34,420 --> 00:07:36,340
‫And that's going to give us the right result.

109
00:07:36,340 --> 00:07:39,370
‫So we're going to have the forward vector multiplied by the axis value.

110
00:07:39,370 --> 00:07:44,110
‫If it's one, we go forward, if it's minus one, a forward vector becomes a backwards vector and we

111
00:07:44,110 --> 00:07:46,240
‫going backwards with just this one function.

112
00:07:46,240 --> 00:07:49,000
‫So that's set us up with move forward.

113
00:07:49,000 --> 00:07:49,530
‫Great.

114
00:07:49,540 --> 00:07:53,470
‫The next thing is to bind for our look up.

115
00:07:53,470 --> 00:07:54,790
‫So let's go and copy.

116
00:07:54,790 --> 00:07:58,480
‫I always like to copy these string references so that I don't make a mistake.

117
00:07:58,930 --> 00:08:02,860
‫Do a look up and instead of binding to move forward, let's go back to the head of file and create something

118
00:08:02,860 --> 00:08:03,160
‫new.

119
00:08:03,160 --> 00:08:07,960
‫It's going to be look up and again, a float axis value.

120
00:08:09,080 --> 00:08:09,770
‫Like so.

121
00:08:10,600 --> 00:08:15,940
‫And if I do control shift P and do create implementation goes ahead and saves me a little bit of time.

122
00:08:16,150 --> 00:08:20,980
‫And this time instead of doing add movement inputs, we want to use one of those other functions that

123
00:08:20,980 --> 00:08:22,330
‫we had at our disposal.

124
00:08:27,060 --> 00:08:32,580
‫Namely the ad controller pitch input because we want to pitch up basically.

125
00:08:32,730 --> 00:08:37,080
‫So this time we can do ad controller.

126
00:08:38,860 --> 00:08:42,550
‫Pitch inputs and pass in directly the axis value.

127
00:08:42,580 --> 00:08:43,390
‫Now.

128
00:08:43,420 --> 00:08:49,510
‫Now be a bit more experienced C++ programmers among you might say, hey, this function basically does

129
00:08:49,510 --> 00:08:49,980
‫nothing.

130
00:08:49,990 --> 00:08:53,650
‫It is just calling some other function with the same parameter.

131
00:08:53,650 --> 00:08:55,540
‫So it's not really doing very much.

132
00:08:55,540 --> 00:08:56,650
‫And you would be right.

133
00:08:56,650 --> 00:09:03,250
‫So what we could do is we could do the a shooter character look up so we could call the function that

134
00:09:03,250 --> 00:09:06,700
‫was defined on this class the a shooter character.

135
00:09:07,270 --> 00:09:13,780
‫Or we could say, well, there's add control pitch inputs that we could just call that directly, couldn't

136
00:09:13,780 --> 00:09:14,200
‫we?

137
00:09:14,200 --> 00:09:21,910
‫So if we use F12 to find out where that's defined and you go and navigate to it, you can see that it

138
00:09:21,910 --> 00:09:24,850
‫is being defined in actually pawn h.

139
00:09:24,850 --> 00:09:30,340
‫So if you scroll up, you can see all the way up here somewhere we're going to find a class.

140
00:09:30,340 --> 00:09:34,690
‫Let's, we could even just search for class space, something like that.

141
00:09:35,430 --> 00:09:38,460
‫And here we've got a pawn is the class.

142
00:09:38,460 --> 00:09:44,820
‫So let's go back to the shooter character and what we can try and just make this a little bit shorter

143
00:09:44,850 --> 00:09:53,910
‫by saying instead let's do a pawn colon, colon, add controller pitch input so that it automatically

144
00:09:53,910 --> 00:09:59,100
‫just directly calls that parent function rather than having to go via our own function.

145
00:09:59,100 --> 00:10:02,700
‫This is a valid way to do it as well, but it's just not necessary.

146
00:10:02,700 --> 00:10:08,070
‫So I'm going to comment it out so that you can refer to it and see it if you wanted to do it that way.

147
00:10:08,190 --> 00:10:12,120
‫But I would recommend doing it the slightly shorter route like so.

148
00:10:30,820 --> 00:10:35,720
‫I and in trying to compile it, I noticed that instead of calling behind Axis, as I'd been wanting

149
00:10:35,720 --> 00:10:38,240
‫to do, I've been doing bind action.

150
00:10:38,240 --> 00:10:41,000
‫So you've probably been screaming at your screen the whole time.

151
00:10:41,000 --> 00:10:42,530
‫Let's go ahead and build that again.

152
00:10:42,530 --> 00:10:46,580
‫By the way, I'm doing that with a control shift B and selecting the build option.

153
00:10:46,580 --> 00:10:53,690
‫That is the simple shooter editor win 64 development build, which is just a quicker way for me than

154
00:10:53,690 --> 00:10:55,940
‫going over and hitting the compile button.

155
00:10:57,140 --> 00:10:59,390
‫I'll look and I can't get my syntax right today.

156
00:10:59,390 --> 00:11:07,070
‫Of course we need to use the ampersand in front of this function to say basically that we want to get

157
00:11:07,070 --> 00:11:08,540
‫the pointer.

158
00:11:09,750 --> 00:11:14,610
‫We want to use the ampersand in front of these functions to actually have the correct syntax here.

159
00:11:21,950 --> 00:11:22,130
‫Okay.

160
00:11:22,130 --> 00:11:28,430
‫So after I corrected those two very common errors, one being that I'd got the wrong function call and

161
00:11:28,430 --> 00:11:33,030
‫the other being that I hadn't got an ampersand in front of the functions I'm trying to use.

162
00:11:33,050 --> 00:11:37,070
‫Let's go over into Unreal and see whether this is actually working.

163
00:11:37,070 --> 00:11:41,930
‫If I go ahead and hit play and use the W key and the S key, you can see I can move forward and backwards.

164
00:11:41,930 --> 00:11:42,800
‫It's amazing.

165
00:11:42,800 --> 00:11:49,040
‫And with the mouse I can look up and down, but it is feeling inverted at the moment to my movement.

166
00:11:49,040 --> 00:11:54,680
‫So I'm just going to go over to the product settings and hit minus one in there and go ahead and hit

167
00:11:54,680 --> 00:11:55,310
‫play.

168
00:11:56,560 --> 00:11:59,140
‫And now if I go up and down, it feels correct.

169
00:11:59,140 --> 00:12:01,990
‫Notice that I'm actually spawning in two different locations.

170
00:12:01,990 --> 00:12:04,780
‫That's because I have to player starts when I put the second one in.

171
00:12:04,780 --> 00:12:08,650
‫I didn't realize there was already one in the level, which is why I'm sometimes spawning here, sometimes

172
00:12:08,650 --> 00:12:10,120
‫spawning in a different location.

173
00:12:10,120 --> 00:12:11,500
‫You might find the same thing.

174
00:12:13,170 --> 00:12:14,940
‫So it is challenge time.

175
00:12:14,940 --> 00:12:22,260
‫Let's get you guys binding your movie rights and you'll look right so that we've got full control of

176
00:12:22,260 --> 00:12:22,920
‫our movement.

177
00:12:22,920 --> 00:12:27,690
‫So repeat the process that I've just done in the lecture for both of these two and you've probably been

178
00:12:27,690 --> 00:12:28,590
‫following along.

179
00:12:28,830 --> 00:12:31,320
‫If not, you can go in and watch to revise.

180
00:12:31,320 --> 00:12:35,340
‫And also I'd like you to attempt the jump function as well.

181
00:12:35,460 --> 00:12:38,160
‫If you're feeling brave, pause the video and have a go.

182
00:12:38,920 --> 00:12:39,270
‫Okay.

183
00:12:39,270 --> 00:12:39,720
‫Welcome back.

184
00:12:39,720 --> 00:12:41,330
‫So let's give this a shot.

185
00:12:41,340 --> 00:12:46,680
‫First of all, we're repeating the above steps for move forward and look up.

186
00:12:46,680 --> 00:12:50,160
‫So we're going to be having move, right?

187
00:12:50,430 --> 00:12:54,120
‫And we're going to be having instead of look up, we're going to be having look right.

188
00:12:54,450 --> 00:12:59,520
‫And we can go ahead and copy these to set up our axes in the project settings.

189
00:12:59,520 --> 00:13:02,160
‫So add another couple of axes mappings.

190
00:13:02,160 --> 00:13:08,190
‫The first one is going to be move, right, which I'm going to map to the key, a four left.

191
00:13:08,190 --> 00:13:10,890
‫So that's going to be the minus one.

192
00:13:11,310 --> 00:13:18,090
‫A is going to be minus one because it's actually left the opposite of right and DX is going to be four

193
00:13:18,120 --> 00:13:18,990
‫going right now.

194
00:13:18,990 --> 00:13:21,210
‫Obviously, you can add in your arrow keys here as well.

195
00:13:21,210 --> 00:13:23,190
‫I'm just not doing that to save time.

196
00:13:23,190 --> 00:13:25,170
‫But you can go ahead and do the same thing.

197
00:13:25,170 --> 00:13:31,170
‫You can just add more keys here, as many keys as you like to map to that single axis look.

198
00:13:31,170 --> 00:13:31,680
‫Right.

199
00:13:31,680 --> 00:13:35,520
‫We're going to use the mouse x.

200
00:13:36,310 --> 00:13:39,910
‫And I think one should be sufficient rather than minus one.

201
00:13:40,180 --> 00:13:41,740
‫I don't think we have to invert this one.

202
00:13:42,520 --> 00:13:45,610
‫And then what we're going to do is we're going to bind this slightly differently.

203
00:13:45,610 --> 00:13:52,330
‫So I'm going to go alt oh to go and create ourselves a move right function here.

204
00:13:53,390 --> 00:13:57,540
‫Now you might be wondering, why are we doing this differently?

205
00:13:57,560 --> 00:13:58,620
‫Why is move right?

206
00:13:58,640 --> 00:14:00,860
‫Why are we not just calling straight to add movement input?

207
00:14:00,950 --> 00:14:02,990
‫The difference is here we're doing a bit of calculation.

208
00:14:02,990 --> 00:14:07,820
‫We're adding in this multiplication by a vector, which is adding a bit of information and justifying

209
00:14:07,820 --> 00:14:09,630
‫the existence for this function.

210
00:14:09,650 --> 00:14:16,030
‫So this time, instead of getting the act of forward, want to get the actor right vector like so and

211
00:14:16,040 --> 00:14:20,810
‫multiply it by the axis value and then we want to be calling instead of move forward.

212
00:14:20,810 --> 00:14:24,980
‫We want to be calling move right now for look.

213
00:14:26,960 --> 00:14:27,680
‫Right.

214
00:14:27,680 --> 00:14:34,310
‫Instead of adding the controller pitch input, we want to be doing the your input.

215
00:14:34,310 --> 00:14:36,380
‫Remember roll pitch and you're from aeroplanes.

216
00:14:36,380 --> 00:14:41,110
‫You can look it up on Wikipedia if you're not sure which one is which and go ahead and build that one.

217
00:14:41,120 --> 00:14:43,190
‫Hopefully this time I haven't got the syntax wrong.

218
00:14:43,670 --> 00:14:49,310
‫Let's dive over to the editor and hit play and there you go.

219
00:14:49,310 --> 00:14:50,510
‫I can look all the way around me.

220
00:14:50,510 --> 00:14:51,470
‫That's looking good.

221
00:14:51,470 --> 00:14:53,150
‫I can strafe left and right.

222
00:14:53,150 --> 00:14:55,010
‫I can go forward and backwards.

223
00:14:55,010 --> 00:15:01,670
‫So the thing left for us is jump, which is going to be an action mapping rather than an axis, because

224
00:15:01,670 --> 00:15:05,090
‫it's a discrete action and I call it jump and copy it.

225
00:15:05,120 --> 00:15:07,640
‫Go over to Visual Studio code.

226
00:15:08,410 --> 00:15:13,780
‫And just close down my compile window and here I'm going to instead of binding an axis, you've got

227
00:15:13,780 --> 00:15:13,870
‫it.

228
00:15:13,870 --> 00:15:18,700
‫I'm going to be binding a action bind action.

229
00:15:18,710 --> 00:15:19,660
‫Simple as that.

230
00:15:19,720 --> 00:15:21,940
‫It's going to start off still with the text here.

231
00:15:22,930 --> 00:15:23,710
‫Of jump.

232
00:15:24,190 --> 00:15:28,840
‫But the thing that is different with axes, as you probably remember.

233
00:15:30,860 --> 00:15:38,570
‫Is we need to use this syntax I input event, which is an enum, which means that it basically can take

234
00:15:38,570 --> 00:15:45,080
‫a number of these different options, double click, press release, etc. We're going to want to jump

235
00:15:45,080 --> 00:15:48,080
‫on press like so, so.

236
00:15:55,710 --> 00:16:02,400
‫So that's I underscore pressed and then once we know that we can go ahead and do the same this and then

237
00:16:02,400 --> 00:16:04,980
‫we want to be calling to jump.

238
00:16:05,280 --> 00:16:07,700
‫Now where is jump defined?

239
00:16:07,710 --> 00:16:08,460
‫Is it in the --?

240
00:16:08,460 --> 00:16:09,330
‫Let's have a look.

241
00:16:10,320 --> 00:16:13,440
‫Nope, but it might be in the character.

242
00:16:13,440 --> 00:16:16,230
‫So I'm going to do a control P and look for character.

243
00:16:20,540 --> 00:16:21,710
‫Dot H.

244
00:16:23,850 --> 00:16:28,800
‫Open that up and just have a look through here, see if they have a jump function defined in here.

245
00:16:29,040 --> 00:16:32,990
‫Jump and then open brackets often is a good way to look for functions within the header files.

246
00:16:33,000 --> 00:16:34,860
‫Sure enough, we have got that function.

247
00:16:34,860 --> 00:16:36,030
‫You can see the documentation.

248
00:16:36,030 --> 00:16:40,230
‫I often like to use the source code directly rather than looking up any documentation files.

249
00:16:40,230 --> 00:16:44,790
‫I just find it sometimes a lot quicker to access, especially when you have access to control.

250
00:16:44,790 --> 00:16:46,770
‫P In Visual Studio code.

251
00:16:47,430 --> 00:16:52,620
‫So what we need to do is instead of going --, colon, colon, we need to do a character colon, colon.

252
00:16:52,620 --> 00:16:56,610
‫So it is going to be ampersand, a character colon.

253
00:16:56,610 --> 00:16:59,190
‫Colon This is because that's the class it's defined on.

254
00:16:59,190 --> 00:17:05,280
‫We can't go looking up the hierarchy when we're doing this colon, colon operator and then it's just

255
00:17:05,280 --> 00:17:05,880
‫going to be jump.

256
00:17:05,880 --> 00:17:07,830
‫So character, colon, colon jump.

257
00:17:07,830 --> 00:17:10,560
‫And don't forget that I need a semicolon on the end of the line.

258
00:17:10,560 --> 00:17:13,890
‫Go ahead and build and see whether we're able to jump now.

259
00:17:17,430 --> 00:17:19,790
‫Well, the build worked out correctly.

260
00:17:19,800 --> 00:17:21,810
‫Let's go over to the sandbox level.

261
00:17:21,810 --> 00:17:24,600
‫Hit play and try and jump.

262
00:17:24,780 --> 00:17:28,380
‫I don't have any key bound, so that might hamper me.

263
00:17:28,710 --> 00:17:35,200
‫Add the space bar in as the key that I want for jump and go ahead and hit play.

264
00:17:35,220 --> 00:17:35,910
‫Yay.

265
00:17:35,910 --> 00:17:39,750
‫I'm able to jump up and down and move through the air and move around.

266
00:17:39,870 --> 00:17:40,560
‫Fantastic.

267
00:17:40,560 --> 00:17:44,760
‫So we've learnt how to bind our axes and actions where we haven't learnt it.

268
00:17:44,790 --> 00:17:51,300
‫We have revised it, but we've seen what we want to bind to in a character in order to get that classic

269
00:17:51,300 --> 00:17:58,950
‫character jumping, strafing, moving and looking with your camera that we all know and love from our

270
00:17:58,950 --> 00:17:59,760
‫shooters.

271
00:18:00,760 --> 00:18:07,590
‫And the next lecture will look at the nuances required for moving with a controller, as well as a keyboard

272
00:18:07,590 --> 00:18:08,400
‫and a mouse.

