1
00:00:05,051 --> 00:00:05,124
outdrive

2
00:00:06,024 --> 00:00:10,463
we are back and ready to start building
out some in the actual gameplay

3
00:00:10,679 --> 00:00:13,900
in our game and that's gonna begin by
creating

4
00:00:13,009 --> 00:00:17,968
and enemy character the weekend interact
with so let's start off by going back to

5
00:00:18,859 --> 00:00:22,160
our C plus plus classes jumped and or
twin stick shooter folder

6
00:00:22,016 --> 00:00:25,805
and here's our base character c plus
plus class once again

7
00:00:25,949 --> 00:00:28,952
I want you right click on that go over
to create

8
00:00:29,249 --> 00:00:32,390
blueprint class based on base character

9
00:00:32,039 --> 00:00:35,728
click and we're gonna name this one

10
00:00:36,079 --> 00:00:40,460
an army character such creative name
Drake

11
00:00:40,046 --> 00:00:43,130
now won a place that in the blue prints
folder as well

12
00:00:44,003 --> 00:00:47,812
click on the create blueprint class
button wait a second and it magically

13
00:00:48,109 --> 00:00:48,960
appears

14
00:00:48,096 --> 00:00:53,105
so well it's drag this up to the top in
adjuster panels when can I see all the

15
00:00:54,005 --> 00:00:55,494
different bits and pieces again

16
00:00:55,539 --> 00:00:59,840
we do have our summer the same stuff we
do with the hero to do so let's elect or

17
00:00:59,084 --> 00:01:00,087
mash component

18
00:01:00,087 --> 00:01:03,726
we will and the SK manikins skeletal
mash

19
00:01:04,509 --> 00:01:09,060
and will place this inside the capsule
just like before

20
00:01:09,006 --> 00:01:12,014
and rotate that ninety degree so it's
facing former

21
00:01:12,086 --> 00:01:17,139
now I don't want the enemies to be the
same color as the hero that's going to

22
00:01:18,039 --> 00:01:19,050
be confusing

23
00:01:19,005 --> 00:01:22,011
just too much to look at so let's figure
out

24
00:01:22,056 --> 00:01:26,825
how we can change that color if we take
the skeletal national double click it

25
00:01:27,329 --> 00:01:30,720
that's gonna open this colossal mash up
in Persona

26
00:01:30,072 --> 00:01:34,089
and it's going to take us right to the
mashed ap so we can pan around them and

27
00:01:34,089 --> 00:01:34,142
see how

28
00:01:35,042 --> 00:01:38,139
awesome this character looks and he does
look pretty cool not gonna lie

29
00:01:39,039 --> 00:01:42,118
but we can also see the materials that
are applied to

30
00:01:42,469 --> 00:01:45,555
and there to love them there is that the
you reform and

31
00:01:46,329 --> 00:01:49,490
body and reform and chest logo which is

32
00:01:49,049 --> 00:01:52,107
actually yes the should be in instance
Arvada

33
00:01:53,007 --> 00:01:58,014
the top on so let's take the arm and
body your uniform and body material its

34
00:01:58,077 --> 00:02:00,139
DoubleClick that now open that up

35
00:02:01,039 --> 00:02:05,938
material under now there's not that much
going on here it's really just blending

36
00:02:06,289 --> 00:02:07,560
together a few

37
00:02:07,056 --> 00:02:10,093
layered materials that you have some
areas that look like Nadal

38
00:02:10,093 --> 00:02:11,175
and dark grey plastic in this

39
00:02:12,075 --> 00:02:15,164
days plastic which kinda dominate the
whole character will

40
00:02:16,064 --> 00:02:20,085
that Bayesian color is a is better
Preminger

41
00:02:20,085 --> 00:02:24,091
and it's named body-color so if we make
a dynamic version at this material

42
00:02:25,045 --> 00:02:29,061
and we change body-color we can thereby
change the color I love this entire

43
00:02:29,061 --> 00:02:30,090
character which is pretty cool

44
00:02:30,009 --> 00:02:33,568
but note the spelling there its body
color without spaces matter fact

45
00:02:34,459 --> 00:02:38,220
I'm gonna selected here inside the
details dental and it controls

46
00:02:38,022 --> 00:02:42,045
sees I don't have to actually typing
leader now let's go back over to our

47
00:02:42,045 --> 00:02:42,139
enemy character

48
00:02:43,039 --> 00:02:46,118
let's go straight to the construction
script I'm gonna drag

49
00:02:47,018 --> 00:02:50,103
a reference to that skeletal mash here
into the construction script

50
00:02:51,003 --> 00:02:54,712
rehab now if you drag a wire of this
what we need

51
00:02:54,739 --> 00:02:58,761
is a dynamic version up the material
that's applied to

52
00:02:58,959 --> 00:03:02,860
index 0 how do I know it'd index here
what we jump back over

53
00:03:02,086 --> 00:03:05,170
to persona notes with element 0 an
element 1

54
00:03:06,007 --> 00:03:10,084
11:00 is the main material element one
is the little chest logo which is just

55
00:03:11,047 --> 00:03:11,108
giving us

56
00:03:12,008 --> 00:03:16,091
the little you re for logo that you see
here were taken some

57
00:03:16,091 --> 00:03:20,137
right up on so let's not jump back out

58
00:03:21,037 --> 00:03:24,053
struggle wire of and I want to just take
the word

59
00:03:24,053 --> 00:03:28,262
dynamic her if you can spot dynamic I
apparently can't

60
00:03:28,739 --> 00:03:32,590
I was so there's create dynamic material
instance

61
00:03:32,059 --> 00:03:35,065
now this is Kennedy do it all at once
node I love this nude

62
00:03:36,019 --> 00:03:39,093
what this is doing is it's grabbing
whatever material was found

63
00:03:39,093 --> 00:03:44,110
in element index 0 it is converting over
to a dynamic version so that you can

64
00:03:45,001 --> 00:03:45,053
change

65
00:03:45,062 --> 00:03:49,110
any parameters that are found inside it
and then once its done that it really

66
00:03:50,001 --> 00:03:51,060
applies it back to that same

67
00:03:51,069 --> 00:03:54,075
element number so will connect that up

68
00:03:55,029 --> 00:03:59,258
and then we just want to do I are we
could set this to a value

69
00:03:59,519 --> 00:04:04,000
you know let's do that nothing will ever
use at less do anyway let's take this a

70
00:04:04,000 --> 00:04:05,004
new dynamic

71
00:04:05,004 --> 00:04:08,097
material we just created promoted to a
variable and we're gonna name it

72
00:04:08,097 --> 00:04:12,160
Dina

73
00:04:13,006 --> 00:04:13,051
then

74
00:04:14,005 --> 00:04:17,033
after we done take the return value that
new

75
00:04:17,033 --> 00:04:20,942
I'm variable drag a wire of it and see

76
00:04:21,239 --> 00:04:24,650
set vector parameter value

77
00:04:24,065 --> 00:04:27,126
like so now this is going to ask you

78
00:04:28,026 --> 00:04:31,105
what primary wanna talk to remember
earlier we copied

79
00:04:32,005 --> 00:04:35,044
body-color so control V there it is
body-color

80
00:04:35,044 --> 00:04:38,108
no spaces but what color we gonna send
it to

81
00:04:39,008 --> 00:04:42,063
well this is where you just decide what
color you want your an immediate be so

82
00:04:42,063 --> 00:04:43,139
let's go with some shade

83
00:04:44,039 --> 00:04:48,077
a red sick animal arms too bright
pregnant

84
00:04:48,077 --> 00:04:52,078
eg so just screams danger

85
00:04:52,078 --> 00:04:55,171
and if you take a look over in the the
ports actually

86
00:04:56,071 --> 00:04:59,078
compile look over the port he turns

87
00:04:59,078 --> 00:05:02,085
bright red which is pretty cool I now if
you want to

88
00:05:03,048 --> 00:05:06,146
you can right click on that value
promote that to a variable

89
00:05:07,046 --> 00:05:13,078
and call this and any color like so

90
00:05:13,078 --> 00:05:16,140
and so now if you take a look at the
viewport you could go over to

91
00:05:17,004 --> 00:05:21,043
enemy color and in the if you compile
this you can now go over the details

92
00:05:21,079 --> 00:05:21,153
panel

93
00:05:22,053 --> 00:05:25,089
and you can set this any shade you want
so you enemy can be

94
00:05:25,089 --> 00:05:28,112
anything he could be bright yellow if
that's your thing

95
00:05:29,012 --> 00:05:32,068
are or he could be orange or on a plane
back to read

96
00:05:32,068 --> 00:05:35,075
will just lead I will decide at rated
just a little bit

97
00:05:36,038 --> 00:05:39,104
there you go said look super dangerous
now you'll notice

98
00:05:40,004 --> 00:05:43,028
this is not changing the color the logo
that's fine

99
00:05:43,028 --> 00:05:46,090
I will just leave it as a a nice little
white logo on his chest or

100
00:05:46,009 --> 00:05:50,101
beige logo whenever but now we've got a
nice visual I differentiation between

101
00:05:51,082 --> 00:05:54,089
our hero in our enemy some issue that
should make it a lot easier to tell one

102
00:05:55,052 --> 00:05:55,129
from the other

103
00:05:56,029 --> 00:06:00,037
on the screen which is great now with
that done

104
00:06:00,037 --> 00:06:03,069
let's setup the controller

105
00:06:03,069 --> 00:06:06,074
the AI controller that is gonna drive
this

106
00:06:06,074 --> 00:06:09,146
enemy around now I'm only doing this cuz
we're only like six minutes into this

107
00:06:10,046 --> 00:06:10,108
video

108
00:06:11,008 --> 00:06:14,087
and it's such a simple thing that I
didn't really want to put it off into

109
00:06:14,087 --> 00:06:15,178
its own video to be really really short

110
00:06:16,078 --> 00:06:20,102
cell I to set this up let's go back out
to our content browser

111
00:06:21,002 --> 00:06:21,095
and

112
00:06:21,095 --> 00:06:24,176
and let's sell right click hearings on a
blue prints folder

113
00:06:25,076 --> 00:06:28,170
and let's make a new blueprint class we
want to base this

114
00:06:29,007 --> 00:06:33,015
offered AI controller which does not
appear in our common classes list

115
00:06:34,005 --> 00:06:37,028
to find a I controller need to click on
all classes

116
00:06:37,073 --> 00:06:40,076
and its easiest to just search that the
search for AI

117
00:06:41,003 --> 00:06:45,094
controller you'll see it really quick
select AI controller and then click on

118
00:06:45,094 --> 00:06:45,156
the green

119
00:06:46,056 --> 00:06:49,115
Select button listening this enemy

120
00:06:50,015 --> 00:06:54,039
AI and will open it up

121
00:06:54,039 --> 00:06:57,039
as just a blueprint like any other cell

122
00:06:57,039 --> 00:07:00,118
has all the same panels will put us all
back like they were and come over to the

123
00:07:01,018 --> 00:07:01,083
event graph

124
00:07:01,083 --> 00:07:04,150
now it's got some components to help it
do some stuffs right so it's got

125
00:07:05,005 --> 00:07:08,086
a transform component it's got it passed
following component which is gonna make

126
00:07:09,031 --> 00:07:10,055
use a nap mash

127
00:07:10,055 --> 00:07:14,142
and then actions on a comp are actions
component which gonna be used for a

128
00:07:15,042 --> 00:07:18,105
for various I behaviors now this as I
mentioned

129
00:07:19,005 --> 00:07:22,047
is going to be a very very simple

130
00:07:22,047 --> 00:07:25,084
AI controller so bledsoe right click

131
00:07:25,084 --> 00:07:28,102
and let's make a custom event

132
00:07:29,002 --> 00:07:32,086
we're gonna call this event track

133
00:07:32,086 --> 00:07:35,092
player as all gonna do

134
00:07:35,092 --> 00:07:38,139
or you could call chase player track
player hun player whatever

135
00:07:39,039 --> 00:07:43,045
I told me the same thing and what it's
gonna do is a special function

136
00:07:43,099 --> 00:07:49,115
called AI move to what this does is this
takes upon

137
00:07:50,015 --> 00:07:53,051
and tell that to move toward a
destination or toward a target

138
00:07:53,051 --> 00:07:56,109
actor and once it gets within the
acceptance radius it stops

139
00:07:57,009 --> 00:08:01,072
the nice thing about this is it will
keep hunting it'll keep moving the pawn

140
00:08:01,072 --> 00:08:02,106
toward that target actor

141
00:08:03,006 --> 00:08:07,020
until it hit the acceptance radius
meaning we don't have to call this node

142
00:08:07,002 --> 00:08:07,084
very often

143
00:08:08,002 --> 00:08:11,041
in order to have something to chase is
our player pretty much all the time

144
00:08:11,041 --> 00:08:14,077
we do need to feed at the pawn that is
being driven

145
00:08:14,077 --> 00:08:17,096
and we need feet at the target the pawn
is being driven is

146
00:08:17,096 --> 00:08:20,164
pretty easy we can just right-click
since this is the AI controller

147
00:08:21,064 --> 00:08:24,153
this controller will be plugged like a
cartridge into the sidebar

148
00:08:25,053 --> 00:08:28,079
our enemy characters head which at a
metaphor that's

149
00:08:28,079 --> 00:08:28,174
not really how it's gonna

150
00:08:29,074 --> 00:08:32,168
there's no cartridge hang upside his
head go with me let's right click

151
00:08:33,068 --> 00:08:36,129
and see get control upon

152
00:08:37,029 --> 00:08:40,063
so that is literally a reference to the
pawn

153
00:08:40,063 --> 00:08:43,094
this I controller is controlling and
will plug that

154
00:08:43,094 --> 00:08:46,141
into pot alright

155
00:08:47,041 --> 00:08:50,042
next we need the target actor for this
let's say

156
00:08:50,042 --> 00:08:55,094
gets player character and there it is

157
00:08:55,094 --> 00:08:58,146
to get the player character and that
becomes the target after

158
00:08:59,046 --> 00:09:02,102
that's all we need to do we just need to
use their so now

159
00:09:03,002 --> 00:09:07,056
when I whenever this is called the enemy
will just move toward the hero

160
00:09:07,056 --> 00:09:10,108
until it gets within five units in five
minutes is fine we don't need to change

161
00:09:11,008 --> 00:09:11,035
that

162
00:09:11,035 --> 00:09:14,101
however we do need to have something
that keeps

163
00:09:15,001 --> 00:09:18,079
calling track player over and over just
he's picking hey

164
00:09:18,079 --> 00:09:21,157
keep checking the player keep checking
the player because if we ever get within

165
00:09:22,057 --> 00:09:22,138
this radius

166
00:09:23,038 --> 00:09:27,094
this hey I moved to will stop firing and
then I'll never chased the player again

167
00:09:27,094 --> 00:09:31,167
if we don't explicitly tell into to do
that we are going to you

168
00:09:32,067 --> 00:09:36,106
set a timer a timer is released

169
00:09:37,006 --> 00:09:40,091
it's actually just like the timer on a
camera there will be a countdown and at

170
00:09:40,091 --> 00:09:41,094
the end the countdown

171
00:09:41,094 --> 00:09:44,181
is going to call some function and you
just type the name in the function

172
00:09:45,081 --> 00:09:48,126
right inside here so we're gonna tell it
to call

173
00:09:49,026 --> 00:09:54,099
track player how often do we want to
track it well let's do it every

174
00:09:54,099 --> 00:09:57,188
one second and this will be looping so
it's gonna keep calling

175
00:09:58,088 --> 00:10:02,137
every second now when do we had noticed
this is not an event right we need

176
00:10:03,037 --> 00:10:03,045
something that's gonna

177
00:10:04,017 --> 00:10:07,039
called it something or plugin to this
execute a bullpen

178
00:10:07,039 --> 00:10:10,064
so let's grab begin play

179
00:10:10,064 --> 00:10:15,103
what this means is the moment this AI
character spawns or the moment the game

180
00:10:16,003 --> 00:10:16,066
begins

181
00:10:16,066 --> 00:10:21,077
this set timer will be called and that
is going to keep calling track player

182
00:10:21,077 --> 00:10:24,102
once a second keep telling the hey i'd
chase the player

183
00:10:25,002 --> 00:10:28,035
over and over so it's compile

184
00:10:28,035 --> 00:10:31,080
let's save then we're gonna take are
enemy character

185
00:10:31,008 --> 00:10:34,072
and said a few things up so let's go
into it class

186
00:10:35,044 --> 00:10:38,143
defaults and we are going to come down
to the

187
00:10:39,043 --> 00:10:42,114
AI controller class property and we can
set that too

188
00:10:43,014 --> 00:10:46,073
enemy AI like cell compile and save

189
00:10:46,073 --> 00:10:49,073
now watch this we take our enemy
character

190
00:10:49,073 --> 00:10:52,134
and Dragon in the world and then hit
play

191
00:10:53,034 --> 00:10:56,037
actually nothing's gonna happen yet
let's just move over to him

192
00:10:56,037 --> 00:11:00,043
is just sitting here being boring so his
behavior is actually there he's got me

193
00:11:00,097 --> 00:11:03,099
in the the requisite microchips in his
hand so to speak

194
00:11:03,099 --> 00:11:06,181
to make a move around we doesn't have
yet is

195
00:11:07,081 --> 00:11:10,167
and navigation mesh and navigation
measures are super easy to do and

196
00:11:11,067 --> 00:11:15,115
unreal watch this governor volumes
Anderson in the place in browser click

197
00:11:16,015 --> 00:11:18,038
on the volumes category and you should
find

198
00:11:18,038 --> 00:11:22,084
the now mash downs volume drag that on
your floor

199
00:11:22,084 --> 00:11:26,090
now this needs to penetrate down into
the floor some move it down a little bit

200
00:11:26,009 --> 00:11:30,101
and then grab your steel tool just gala
doubts were completely covers the floor

201
00:11:31,082 --> 00:11:35,091
and hit the P key to visualize your mash

202
00:11:35,091 --> 00:11:38,126
and there you go there's a navigation
ish

203
00:11:39,026 --> 00:11:43,031
already done so again super super easy
so now if we hit play

204
00:11:43,031 --> 00:11:46,088
oh my goodness the he so fast

205
00:11:46,088 --> 00:11:49,150
we can get away from him that's that's
actually kinda ridiculous we need to

206
00:11:50,005 --> 00:11:50,087
slow him down

207
00:11:51,032 --> 00:11:55,075
so would stop playing let's go to you

208
00:11:55,075 --> 00:11:59,086
our enemy character local right into the
movement component or character moment

209
00:11:59,086 --> 00:11:59,091
component

210
00:12:00,036 --> 00:12:05,045
and let's grab the max walk speed I'm
gonna pull that down to you

211
00:12:05,045 --> 00:12:09,074
IRC she to

212
00:12:09,074 --> 00:12:12,123
and read that apply make the game too
easy but you can always tweak it later

213
00:12:13,023 --> 00:12:18,023
soul compile and save now will hit play
and there you go

214
00:12:18,023 --> 00:12:21,028
he is just chasing us and he'll keep
right on chasing us

215
00:12:21,073 --> 00:12:25,079
over No if he touches us he'll wait a
second then Hill go again

216
00:12:25,079 --> 00:12:28,170
so there you go we have

217
00:12:29,007 --> 00:12:32,013
and any with his own little AI that is
just chasing the player

218
00:12:33,003 --> 00:12:36,055
which is pretty awesome so let's go
ahead and get outta here

219
00:12:36,082 --> 00:12:39,124
that is going to wrap things up for this
video

220
00:12:40,024 --> 00:12:41,863
thanks a lot

221
00:12:42,079 --> 00:12:48,147
for


