Welcome back.
So we're ready to make a ghoul enemy.
And that's going to involve several steps, isn't it?
Because we need several things that are ghoul enemy may not have yet.
So let's start at the beginning.
We're going to go into content, blueprints and character where we have our goblin slingshot and Goblin
Spear.
Let's make a new folder called Ghoul, and our Ghoul is going to have a character blueprint based on
enemy base and an animation blueprint based on an enemy just like our spear, goblin and Goblin Slingshot
have.
So first I'm going to right click on Enemy Base, create a Child Blueprint class and call this Bpy underscore
Ghoul.
And I'm going to move that into the Ghoul folder.
I'm also going to right click on AVP Enemy and create a Child and in Blueprint with Skeleton choosing
the ghoul skeleton SRC ghoul create child and call this AVP underscore ghoul.
So we have that as well.
We'll move that into the ghoul folder too.
Now for the ghoul, let's open up ghoul and first we can set its skeletal mesh.
We're going to choose Mesh selecting Ghoul and I'm going to go ahead and press E I have snapping enabled,
in fact 45 degree increments and I'm going to go ahead and move the ghoul down.
Like so and I think that's pretty good.
I'm okay with its head being completely out of the capsule.
I think that's totally fine.
But of course we can always adjust right now weapon.
We're going to leave blank, but we're going to take BP Google Self and just take a look at some of
the properties that we want to set here.
We have combat lifespans.
Five seconds.
That's for when the ghoul dies.
We have attack montages.
We're going to need some montages.
We have the weapon tip socket name.
Well, it doesn't have a weapon, so we can leave that at none.
But we did create left and right hand sockets on the skeletal mesh.
We have left hand socket and right hand socket.
We can set those here on BP ghoul.
So left hand socket name will be left hand socket.
Right hand socket name will be right hand socket.
Now we need to hit react montage.
So why don't we create that real quick?
We'll go into content assets enemies, ghoul animations and looks like there's a typo in animations
on mine.
By the time you've taken the course you'll likely see that that's been fixed.
I'm going to go ahead and fix it here.
And we're going to make a hit React montage.
I'm going to right click on Hit React.
We're going to create and in montage and this will be a m underscore hit, react, underscore Google
and I'm going to open it up now.
Let's see what some of our other montages have in them.
We're going to go to enemies.
Let's go to Goblin Animations spear and see the hit React.
And I see that it's empty.
We're not doing anything here, so we can just leave that hit React for the Google as well.
So we'll go back to BP, Google and set this hit React montage to a m hit React Google.
And that takes care of that.
Okay.
We also have default primary attributes, secondary and vital, but those are actually not used anymore.
That's something that we set in the data asset.
So our ghoul should be initialized from that data asset provided that it has the correct class type.
The character class.
And that's under character class defaults.
Character class here should be warrior.
That's what it is by default.
So that looks good.
Okay, so we also need an animation blueprint assigned to our ghoul.
Let's go to our animation blueprint and content Blueprints, Character ghoul, a Ghoul.
And the only things we need to set here are the asset overrides.
But we need a blend space.
We don't have one for the ghoul.
So we're again going to need to go back to our animations folder for the ghoul.
I have my hit React, I'm going to browse to it and we need a blend space for idle walk.
Run.
Looks like I have an idle animation and a walk animation.
These are perfect for a blend space.
So we're going to right click, go to animation, go to blend space and choose our school and call this
BS underscore idle walk.
We'll call it idle walk.
We'll open it up.
And how fast is our ghoul going to travel?
Well, we're not sure yet, but we're going to have horizontal axis.
We're going to call it speed.
The minimum can be zero.
The max.
We'll just leave it at 100 and we'll drag the idle in.
I'm going to hold shift so it snaps all the way to zero and I'm going to drag, walk and shift, snap
it to 100.
So we have an idle walk.
Okay, cool.
So now that we have this blend space, we'll go ahead and save it and go back to app Google and choose
Idle walk, compile, save and go back to our Google.
Choose the mesh and use this animation blueprint app Google.
And now we see that our Google is idling and it's looking pretty cool.
Okay, so that was kind of a lot.
But stuff that, you know, stuff that you've done before, right?
We can compile and save that now.
How's the Google going to move around?
Well, it needs a behavior tree, doesn't it?
So if we search for behavior Tree and we'll have to click on Google Self, we see that it has a behavior
tree.
That's because that's set in the base blueprint for our enemies.
But it's good to check just to make sure it's set there.
All right.
So the next thing is to add some attack montages.
I think that's a good thing to do in the next video.
In the meantime, though, we can place one of these in the world and just kind of see what happens
when we press play.
So I'm going to take my BP ghoul and browse to it and then drag one out here.
Right about there.
And I'm just going to save all and press play.
And here we see it is walking towards me.
It's chasing me.
And it looks like it hit reacted.
Something hit it.
Oh, it looks like the enemy hit it.
I can also hit it myself.
So that's working.
So it's looking great.
It has a little bit of clunkiness when it turns kind of like our enemy goblins had before we went into
the blend space and set our setting for the weight right here under sample smoothing, we have weight
speed.
I'm going to set that to a value of about four and see if that looks a little bit better for our enemy.
Now, another thing is our enemies walking a little bit too fast for its animation.
So that's something I'd like to fix, but I am seeing that the enemy is still clunky and I do get a
blueprint runtime error.
We're trying to access index zero from Git attack montages.
That's because our attack is trying to get index zero from an array that's empty.
So really we should be checking length and making sure that it's greater than zero so we can have a
condition here for that.
I know that this is a little messy.
I'd like to move this into C plus plus, but we're going to make sure that that's the case.
Otherwise, I think we could just call end ability here.
So making sure not to try to index an array out of bounds in blueprint blueprints.
Nice to us in C plus plus, if we try to do this, it would crash, right?
But let's go back to our BP goal.
Let's make sure that use controller rotation, pitch yaw and roll.
Those are all false.
Perfect.
We do want to use controller desired rotation on the character movement component and we want to check
out the rotation rate.
It's set to 360.
We may want that rotation rate a little lower.
I'm going to try 100.
That might actually be too low.
Yeah, that's way too low.
Let's set it to 200.
We'll maybe hone in on that before we wrap up.
I think that's looking better.
And of course, it's not going to get to attack me until we have some attack montages made.
We'll do that next.
But yeah, I think that's looking pretty good.
And also, I did mention it's walking too fast, so we do have a walk speed variable that we added,
I believe.
Let's see what we called it.
It was in the aura enemy class.
We're setting it in hit react tag changed.
We're setting the max walk speed to our variable base walk speed and I believe that should be exposed.
Base walk speed is it's actually just blueprint read only.
I'd like to expose that to the details panel so we can make our ghoul walk a little slower.
So I'm going to close and just really quickly make this edit.
We'll make it edit anywhere.
And I'm going to adjust that on my Google blueprint.
All right.
Let's go ahead and open that back up.
Here in the BP Goole open full blueprint editor I'm going to look for base walk speed and I'm going
to set it down to a lower value.
Let's first try 150, see if that doesn't look too low.
That looks a great deal better.
In fact, I might put it down to about 125, but not much lower.
Let's see how that looks for our Google.
He is just a big, lumbering guy.
That looks good.
Now he's turning a little bit quickly, I think.
And this really just has to do with his sheer size.
But I'm going to set his rotation rate to probably 150.
But.
We'll see if that's too low.
No, that looks pretty good, actually.
Yeah, it's going to be a slower anime.
And it can take damage.
Excellent.
Okay.
And I know that our enemies take way too much damage.
Their health is too high for a level one enemy.
I know.
So that's something we are definitely going to fix, one thing at a time.
Right.
But we have an enemy.
A second enemy, actually.
A third enemy.
Two different kinds of goblins.
And we have this big dude, so great.
Now it's not attacking.
We need to make some attack montages.
We need to set its array of attack montages.
So a couple things left to do, and we'll do that next.
Excellent job and I'll see you soon.