Hello, this is Younghoon Lee
This time, we are going to apply the enemy asset
and try processing animation
In this unit, we're going to change the outer appearance of the enemy
and use an animation blueprint
to learn how to control it as a state machine
And with the state machine created by C
we're going to learn how to synchronize it with
the state machine of the animation blueprint
Finally, using the animation montage
the attack and death animation
will be configurated into one animation sequence
and we'll learn how to control it
Changing the outer appearance of the enemy and synchronizing the C FSM and animation FSM
This time, we're going to change the appearance of the enemy
The enemy looks like this right now
We're going to change it
We're going to use this
If you look here
First we'll paste it here
The information here
is in the vampire form
I took this from a platform called Mixamo
The Mixamo website is provided by Adobe
If you look here, there are characters and animations
There are enemies here
We're going to use the Vampire
And for animation, we're going to use the animations here
There are many of them here
If you look into it, Mixamo has free license
It's completely open for personal use
So we're going to use this for our example
Like this, the animation is all prepared
Basically, the Idle position
and the Move position for moving
and death processing
There's reaction for being shoot by a gun
We're going to put about two reactions and process it
And the Idle position for attacking
And the attacking position
We're going to use these 7 animations
Let's now apply these
We'll proceed directly on the code
Go to the constructor of Enemy
and we're going to change this part
Right now, it's in Quinn
We'll move our downloaded file into Models
Like this, move it into the Models file
In the Models
This one, select this
Select the Skeletal Mesh and copy it
Click Copy Reference
And here, the path isn't this anymore
We'll change it like this
And we're also going to control the animation as well
Compile first, and let's see if it changes
Go to Enemy, then Mesh
It's not applied right away
Let's close it and open it again
There's an undo button here, and now it changes
Compile it and see
Now you can see that it's changed into a vampire
We're going to add animations to this
Same thing here, create the animation blueprint
and add it here
Then
Let's make one first
Blueprint
Go to Animation, then Animation Blueprint
Like this
Here, the Skeleton is at the very bottom
It says vampire
Select this, and click Create
We'll name it WBP_Enemy
and double-click this
We're going to produce it
Basically, it will be FSM-based
So right-click here
Type state machine, and it's here
We'll name the State Machine "FSM"
And connect it like this
It goes in like this
For our Enemy
if you look at the header of EnemyFSM
there are 5 types of states
The basic ones, IDLE, MOVE, ATTACK
We'll make these three states first
There are animations here
Let's try using them
For the Idle position, we'll use Standing_Idle
Bring it like this
We'll call this "Idle"
For moving, we'll use Run
Like this, and we'll name it "Move"
Then we just need to connect the transitions like this
Let's enlarge it a little
Then we're going to make Attack
For Attack, after attacking
Or, as soon as the animation is initiated
It doesn't attack right at the time of transition
Here, when you take a look at Kick
it's in the form of kicking
So we're first going to use this
But it will be like this
Here, choose Add State
Name it "Attack"
From Attack, we may move back to Move
So we'll make it like this
Then go into Attack
And within Attack, there will be another state
A sub-state will be made
Idle
Move
Then it will attack
The Attack state is
if you look into it in detail again
We're going to make it into this state
We're going to add two more states
conceptually. There's the Attack state
and then there's the Attack Idle
Then after the attack animation
it comes down this way
Once the animation is over, it goes into Idle automatically
Then in order to go into Attack again from Attack Idle
we're going to add a condition
For this, it will be auto
In this form, we're going to fill in this part
We're going to add it here
Then in this condition
something like bAttack
A variable like this will be made
So after it attacks
the basic state is in false
Once it becomes true, it transitions to Attack again
We'll control it in this form
Then come back here
We'll have to make another state here
State Machine
We'll name it AttackSubFSM
Double-click to enter
Here, add attack, and attacking is Kick
We're going to use Kick for attacking
Name it Attack
After Attack
it's going to go into the Idle state automatically
This time, use Unarmed_Idle
We'll assume this position
We'll name this AttackIdle
There may be various positions for standing
So like this
So going from Attack into AttackIdle
will be Automatic
And going back the opposite way
we're going to make a condition
So we're going to add a variable here
We won't add it right away
First save it
There are going to be some errors right now
because we didn't add conditions here
Create an animation blueprint
and make a variable there
That's how we will configurate it
Then come back to here
In Tools, we're going to make a Class
Here, type Animinstance
we're going to produce this
This is for Enemy
Click Next
EnemyAnim
That will be the name
For Player too, it was PlayerAnim
Like this
Similar rules for this as well
Create it like this
Go to the header file of EnemyAnim
We'll add a variable here
The variable we're going to add is
First, put public
Here, we're going to create a state
State. This state actually
is the state here, in the EnemyFSM
Here, we created a variable called State
We're going to use this in EnemyAnim
But since we're going to use it in blueprint
we're going to create a variable here
So over here
Using the same name written in the FSM header
Copy it directly into here
But to use this
the header has to be added
Take the header of EnemyFSM
and add it here
include "EnemyFSM.h" file
Type it like this
Then we can use it
Since we're going to use it in blueprint
put UPROPERTY here
Choose EditAnywhere
And in blueprint
we're going to allow it to be read
We're going to use ReadOnly
Since you're a little more familiar now
instead of EditAnywhere
EditDefaultsOnly will be more correct
Let's change it a little like this
So read this in blueprint
Since it's going to read it, changing this value
will be written in the C code
Then reading it and interpreting it
will be done by blueprint
That's why we set it as ReadOnly
We're going to make another one
We need the concept of bAttack, as mentioned earlier
So use UPROPERTY the same way
Let's copy it
It will be a bool type
and make a variable called bAttack
And this has to be inherited
Save it
Come back to Unreal, and compile it
Go to WBP_Enemy
Save it first
Then in Class Settings
let's change it
Type EnemyAnim
It's here
We'll change it like this
Then in the parent class
there's a variable
So we can use it here
To see it, it's not appearing right now
To see it, click the gear wheel
There's something called Show Inherited Variables
It means whether you want to see the inherited variables
Check this off
For the parent, there's Enemy Anim
Here, the State and Attack are shown
You can see it like this
Then using these variables
we're going to fill in all the conditions
The condition of going from AttackIdle back into Attack
If Attack is true
then it can go back like this
That's how we'll assign it
Then these two conditions are satisfied
Let's go back
Go to the FSM part
Now we need to fill in these three conditions
Going from Idle to Move
Double-click on it, and use the State here
If the State is Equal
Type == and there's Equal (Enum)
Use Equal (Enum)
Once the state becomes Move
Right? Because it goes from Idle to Move
If the state has changed into Move
Then true
We're create a condition to transition it
Then the condition looks like this
If State and Move are equal, then transition
That's what it means
For these two as well
let's make it too
Going from Move to Attack
and going from Attack to Move
We'll use this rule as well
For Move to Attack
Same thing here, use State
Type == on State
Select the one that says Enum
Then this is going into Attack
So change this into ATTACK
We'll connect it like this
Since we're going to use the same method
let's copy this
Then for Attack to Move
This will now be MOVE
If it became Move
transition from Attack to Move
We can make rules like this
If needed, we can also connect like this
Same thing here, add it here
This is now IDLE
If the state is Idle, then transition
Assign it like this
All the conditions have been made and the possible transitions
have been configured
Let's preview this
First, there's the Idle position
Select MOVE, and now it walks
But wait, the animation doesn't repeat
We'll first have to repeat all of them
Check off Loop Animation for all of them
Even for those in Attack
We'll repeat Kick as well
We'll repeat AttackIdle for now as well
Check off Loop for all of them
Let's see the results again
For IDLE, it will be like this
Select MOVE, and it will walk
Walk, then ATTACK
Then it kicks, then goes back to idle
But I think I assigned Idle positions the opposite way
I switched up Unarmed_Idle and Standing_Idle
We'll switch it
Change Standing_Idle into Unarmed_Idle
I made a little mistake here
I'll do it again
Select Loop Animation
For AttackIdle, not this but
change it to Standing_Idle
Let's try it again
Preview again
IDLE is this position
Then MOVE is walking
Then for ATTACK
It attacks, and then
I wanted it to go into a threatening Idle position
So I did it again like this
Then in order to attack
there's a variable called Attack
If you check this off, it attacks
It attacks repeatedly if this is checked
If this is not checked, it attacks once
It goes back to Idle
If you look here, if I check it off then uncheck it again
It stays still
And if this is true, it attacks
If unchecked, it stays still
After making it work like this
control these variables in the code
then the forms of animation that we want
can be configured
Then first, save it like this
Let's implement it
Go to the source file of EnemyFSM
We're going to control it here
But in EnemyFSM
I think we should change the variable in EnemyAnim
In EnemyAnim, we
made two here
Changing these
should be done in EnemyFSM
Then we should bring it from here
now that I think about it. Then in the header
Go to the header of EnemyFSM
We'll make that variable and control it
Then under Me, write UPROPERTY once again
class UEnemyAnim
Set it as a pointer
This will be EnemyAnim
Then this has to be filled in
We can bring this in from Me
Then animation blueprint
has to be brought over, now that I think about it
Then let's go to Enemy. Go to Enemy
I have EnemyAnim here
then use that here
We'll approach it that way
Here, type UPROPERTY
Let's do it like this for now
Let's just put this in for now
EditAnywhere
Put class
We'll put UEnemyAnim
Then this has to be loaded and added
Normally, factory is made
After reading it
then it has to be assigned
But instead of doing that this time
we'll load it right on here
Go to the header file
Here, under this
Should we do it here, right above FSM
We'll load this and fill it in
Then in ConstructorHelpers::F
EnemyAnim is actually in a blueprint
So this time, instead of Object
using ClassFinder
we'll read it in
What it will read is UEnemyAnim
It's going to read like this
Should we do TempAnim
Put TEXT
The path here
can be added as well
We'll have to find the path then
Go here
What we're going to read is this
WBP_Enemy
If you look here
you can also do Copy Reference here
Bring it in
Then write it here
Then for this
we'll have to see if loading succeeded
If load was successful
In GetMesh, there's SetAnimInstanceClass
Here, the loaded TempAnim.Class
can be inserted like this
This is Class
We found Class using the Finder
That's why we added Class
There's no Object here at all, right?
Add Class
And when putting this in
for loading, the path is like this
At the end, put _C
in order for it to load properly
Then now this is going to be filled in
To fill in EnemyAnim
this isn't done within Constructor
It has to be filled in on BeginPlay
Then the configuration will be like this
For filling this in
bring in AnimInstance again from GetMesh
In GetMesh, GetAnimInstance
Bring it in like this
For this, the data type is a little different
For AnimInstance
UAnimInstance is returned
This can be used by casting
Put Cast
Like this, UEnemyAnim
You can use it by casting, like this
Then we'll add the header first
Add the header like this
On top, the Anim header was added
And now that we've configured everything
we can use it in FSM
Then in FSM, go to BeginPlay
Let's fill in EnemyAnim first
In Me, fill it in like this
Let's compile it
Turn off Unreal for now
Let's build again
And execute it again
Using this, we're going to configure
Let's look at the attack motion of the Enemy
If you look here, the attack motion is in here
Then if the attack motion is like this
then the actual time of hitting will be Hit
This part has to be the Hit
And when the animation is over
we'll have to know it
So for these two instances, the time of Hit
and the time of animation ending
We want to know these two times
So rather than measuring the time
we can add Event here and find out
It will be around here
This is the actual time of hitting
When the animation is played, it doesn't Hit right away
This is when it Hits
Then the motion is over
This is what we want to know
So at around here, we're going to add Event
It says Notifies here
Where it says 1, follow along to the right
Here, right-click on it
We can do Add Notify
Here, select New Notify, and name it Hit
We can write it like this
And around when it ends, right about here
We'll add another one here
We'll name it AttackEnd
It already says it here
We added Notify
Then, after adding Notify
the way we can know this, is that
this corresponding animation sequence
is owned by an animation blueprint
In EventGraph
we can find that out
Here, it was Hit right?
Type hit
There's something called Event
AnimNotify_Hit
And there was another one
We also had AttackEnd
We'll add AttackEnd as well
We can be notified this way
Then if we get notified here
we need to send the signal to Enemy
So we'll create that structure
If you see here, you're getting notified from here
Then if you're notified from here
it was received from the blueprint part
Then it should be called again
in the C code part
Then here, put UFUNCTION
put void, then let's make a function called OnHit
And using the same name
Not name, using the same structure, put OnAttackEnd
Make it like this
And for this, we're going to make a function
that can be called from the blueprint part
So in UFUNCTION
there's a specifier called BlueprintCallable
We'll put this in
Like this
Create the implementation like this
And this action is actually
not done here
But it should be done in FSM
So in FSM, make it with the same name
So when it's called from Anim
the function in FSM will be called
We'll configure it like that
Go to header
We'll write it right under here
We don't need UFUNCTION here
Make the implementation like this
Like this
Save all of this
And now this has to be implemented
We'll do our implemented part in Anim first
Here, we want to call FSM's OnHit
Same thing for this
Same method for the bottom one as well
Here, we want to call this
This is how we're going to configure it
Then here, there's this thing
There's TryGetPawnOwner
We can bring the Owner
The Owner here is the Enemy
So bring the Enemy
and we'll call what's inside FSM
Then we'll have to Cast first
Cast AEnemy, like this
We'll cast to use
We'll put auto enemy
Then if this is not null
Then in enemy
This is a pointer, so we'll put this
In enemy, the FSM
Actually, we need to check null for this as well
So like this, &&
Doing this would be more safe
We need to add it to the header to use it
This FSM has to be added to headers as well
In here, OnHit
It means that it's calling it
To use this
FSM has to be added to headers as well
We'll call it here using the same way
Here, it's OnAttackEnd
So when neither are null
we can call
Then taking this structure
we'll finish implementing in FSM
Go to the source file
These are the actions during attacking
The things we did
So these are all for attack
Actually before doing this, we
create a variable for attack
We created a variable called bAttack
Making this true and then false
This is what we need to do
So at the time of Attack, make it true
Then in EnemyAnim
bAttack becomes true
And to use this
of course, the header has to be added
EnemyAnim, on top
Let's add it like this
And for the implementation that we made
Once Attack is over
Attack will become false
Then it can go into Attack again
But there's something to do here
Once the Attack motion is over
we need to decide something
So if the target
If the target is within the attackable distance, do this
Attempt Attack once again
If not, transition to the Move state
It needs this structure
Something to check in OnHit as well
Let's say it extended its leg
but for this instance as well
we need to check if it's within the attackable distance
If so, it attacks
If it is, attack
If not
If not, do nothing
Or else it will kick at the air
We'll add these kinds of conditions
Then the existing contents of Attack
will have to be edited a little
Here, if time passes the attack delay time
then attack. These are what we did
Actually, these are not needed anymore
All of these are not needed, actually
We can control it through Event
Here, since we don't have those
we processed it by measuring time, but
here, we're going to measure the distance from the target
This part has to be done
Copy this and bring it
Here
It will be around here
When the attack motion is over
I added comments but
It's this
This has to be checked here
So if the distance is less than the attack range
Like this, less than
Let's do less than or equal to
Get it
It's this
It will be like this
So here, do this
If not
And that's else
So it's outside the attack range
Then transition to the Move state
What I wrote, is this
I wrote it as is
The attack motion ending means
that this function has been called
Get the distance from the target
and if it's within the attack range
then attempt attack again
If not, transition
And it should be done for this as well
Should we copy it
Like this
Get the distance from the target
If it's within the attack range, attempt attack
Here, it's not this, but it's Hit
The log that we outputted up here
will be outputted here
We'll switch it like this
Then the function that we made
should be callable from there
The two functions that we made in Anim
needs to be called from the blueprint side
Compile first
Here, there's On Hit
Call it
For this, On Attack End
They can be called like this
Let's execute it
There's an error
There was an error in line 95
It will be good to take a look at these
If it's line 95, it's here
We'll have to check if the Enemy exists
Let's try run-time debugging
Press F9, then F5
Then we can do run-time debugging on this
Then let's take a look at this first
Errors can occur easily like this
Let's check it again from here
When we execute it, it gets stuck here
Now that I see it
My EnemyAnim isn't filled in
Then I'll change it a little
Here, let's bring it ourselves
Normally, our Enemy
It was normally filled in on BeginPlay of Enemy
Let's do this here right away
It will be GetMesh of Me
Let's fill it right away
Do this
Ah now it's filled in
Let's proceed this way for now
If you see here, the Enemy exists. The Anim
And we'll change this
But seeing how it's not being applied on animation
I think there's more we need to look at
In the Idle position
Let's take a look slowly
Go to Enemy blueprint
IDLE, then MOVE, then ATTACK
There's no problem here
If you see here, there are signals going in during the attack
There's no problem here
so I think there's a problem in the flow here
Now that I think about it
Did we change the State of EnemyAnim?
In State.. ah this was not done
Here, we only changed the state of FSM
And for the Enemy's State
in the animation part of the Enemy
we created a State
but we didn't fill in the values here
So I think that's why it's not performing the motion
So let's fill it in here
EnemyAnim's State
like this, newState
We'll change it like this
Here, yes
Execute debug mode again
Let's look at the execution results after building it
Execute it, and now it's reacting
It attacks
And it approaches like this
But that guy is not looking at me
For that, go to Enemy
In Character Movement, we
didn't check this
Orient Rotation to Movement
Check this off, and in the direction of its movement
it rotates and comes
This wasn't checked off
After checking it, let's apply it again
Like this, when it moves, as well as when it attacks
it rotates its body when it approaches me
Attack and Death Animation Sequence Configuration
Then now, we're going to shoot with our gun
to process action on that guy
We're going to give Damage
And when it receives Damage
it will fall
We'll try those productions
We'll make another montage
We're going to make a montage on the Enemy
Here, go to Animation, then Animation Montage
We'll select vampire
We'll name this Montage_Enemy
Double-click to open
Here, we're going to add animations
Here, the animation for reacting
Once there's Damage, reactions such as ouch
That will be added
Here, there's Standing_React
And right under it
there's Sword_And_Shield_Impact
Execute it, and it's like this
The two reactions are applied
And while we're on it, we're going to process death
Here, there's Death
We'll add Death here
When it dies, it falls over like this
Those are the motions
To control this
we're going to create a section
Right now, there's only Default
We're going to do Damage 0, Damage 1
We can change the name here
Damage0
And here
This is where it starts
The second one
Select New Montage Section
Here, we'll name it Damage1
Adjust the location well
And here, we're going to name it Die
Die section. Write it like this
That's how we'll configure it
And if you look here
the sections are like this
When it's proceeded
When the montage is played
If it starts from the beginning
0, 1, Die
And it ends. That's the structure
If you see here, once Damage0 ends, do Damage1
then do Die, then end. That's what it says
Press Clear, and they become separated
Now it's separated into sections
This way, when Damage0 section is proceeded
the montage ends there
So if it's configured like this
we can control them by sections
After configuring it like this, let's control it
And here, we're going to create a slot
If you look at the slot here, unlike the player
the contents are a bit different
So here, click Add Slot
And we're going to use Damage Slot
Here's one, Damage Slot
We'll use this as is, Damage Slot
Then this has to be applied to animation blueprint
Go to AnimGraph
We're going to make the slot float here
Type DefaultSlot
DefaultSlot must be added first
Connect it like this
Then we'll change the name here
We'll change it to DamageSlot
You have to pay attention to the name
Change it like this
Then we just need to play it
Save everything
And now, for the function that plays the attack damage
here in the Animation Blueprint
This is where we'll control it
Then
We'll first have to make one
Then Animation
Go to where AnimInstance was inherited
Here, put UFUNCTION
This time, we're going to make this function
void PlayDamageAnim
Should we do it like that
Then for Fname, we'll put section
We'll put sectionName
And implementing this
will not be done within the code
We'll implement it in blueprint
Here, write this
There's something called BlueprintImplementableEvent
If this is done, the actual implementing
is said to be done in blueprint
Then let's go to blueprint
Go here
Here, go to EventGraph
Here, what was the name earlier
PlayDamageAnim
Ah we should compile first
Again, compile
Type Play Damage Anim, and it appears like this
And here, you know the Try Get Pawn Owner?
Bring this
Cast this
It would be Cast to BP_Enemy
Cast it like this
And here
Play Anim Montage
Do that
Then the Section Name here
will be inserted this way
And open it
We're going to use Enemy
So change Anim Montage into Enemy
That's how we'll configure it
Compile it
Then once this function is called
this action will be performed
Then where this is called, will not be here
When damage is received
in FSM
when it's OnDamageProcess
This is where it should be called
Here, it received Damage
It's going to React
And here, it's going to Die
So in EnemyAnim
PlayDamageAnim
like this
Call it here
We'll insert it by TEXT here
Here, type Damage0
Here, we'll have to put Die
But we want to make it random
0 or 1
So we're going to do a random process
First put int32 index
This is random. So in FMath
there's RandRange
We'll use this function
This is 0 to 1
We're going to randomly choose one of these two
Then we're going to insert this here
First, we need to use FString
FString, like this
We'll put sectionName
Then in FString, there's the Printf function
Using this will make it simple
Here, put TEXT("Damage%d")
comma, then index
That's how we'll configure it
So this index here
Oh not index
This sectionName
needs to be inserted after changing it to FName
This will be FName
Write it like this
When changing FString to FName
configure it like this
Then let's compile it now and see the results
Before that, now that I think about it
I left this as Default
We'll change the name again
We put Damage, and we didn't apply it
Save it
And... that should be good
Here, the DamageSlot
is performing the animation
Then execute it, and let's see the results
Shoot it, and like this
You can see that the animation is applied
It kind of falls over weirdly right now
After the falling animation is over
the next motion has to be continued
but it goes down as it falls
So we're going to control this
Here, in the header of FSM
Let's process it here
bAttack. There are no related ones, right
Then we'll write it on the very bottom
Put bool bDieDone
We'll make a variable like this
The role of the variable is
whether the animation is complete
that's what it will be checking
Then go here
When Die Animation is performed
first, put bDieDone as false
Once Animation is finished
then set this to true
And then this becomes true
when you look up
you know the part where Die is being performed
Here, this is blocked
If this is false
then return
Like this
Then there should be a time when this becomes true
Once Animation is over
So we'll process that too
In Montage
for Die, this is going to be processed
And it's going to end here
It will about here
Then if you look here
Die extends here
but we're going to end it here
Let's add an Event here
On the Notify part
write it like this
In Add Notify
the Animation called DieDone
An Event here
Notify will be added
Type DieDone
Should we call it DieEnd?
The same way
Create an End
Then when it Ends
then it has to freeze in this state
But if you look at the structure
it flows like this
And even if there's an Event here
it already ends here
The animation ends
But because of that
if we choose to repeat Die
What happens is
DieDone occurs, it reaches here
Then it will do the same thing from the beginning again
Then this animation will repeat like this
That's awkward
Since it has to repeat the dead state
we'll make another Section here
We'll make it here
So around here, add Section
Should we name it DieLoop
Then it just needs to repeat this part
When it reaches DieEnd
move over to this section
and process it so that it repeats this part
Then for now, Clear them
We're going to proceed with DieLoop after Die
Then once we're at the Loop
repeat infinitely at the Loop
If this goes back to Die
it's going to go back to here, then repeat
But if this is set as DieLoop
the corresponding section will be repeated
Then when the Die Event occurs
and it will go down
and meanwhile, the animation will be repeated in this section
That's how we need to configure it
The Notify of this Event
needs a function process
Then this time, when we processed this all along
here in animation blueprint
in the EventGraph
is where we made it
In truth, we don't make it like this
This AnimNotify_ here
and the name here, like DieEnd
If functions of these names are implemented
if it's declared in the source, the header
we don't need to use this
We don't need to make it this way
So we can do it this way
but we can do it another way
Let's try it
Come here, in Anim
This was that role
Here, type void AnimNotify
including the _
The name is the same as the name here
AnimNotify_
The same name from here
is used for creating the function
What we did earlier is DieEnd
Then we'll have to write DieEnd here
We'll give it UFUNCTION here as well
This is needed for reflection
That's how they will recognize it from there
Make the implementations like this
Once DieEnd is reached, what we want to do is, in FSM
FSM's bDieDone becomes true
Since the falling motion is over
now move down into the ground
We want to do that here
Then we'll bring this as is
Bring it here
Put bDieDone = true
Write it like this
Compile it, and let's see the results
Compile it here
Execute it
Shoot it, bang
It pauses, then approaches again
Then bang! It falls, and then
Once it's over, move down
It should move down but it's not
Let's check this again
When checking this, first
try making Notify here again
When it's implemented into the header
if it's properly implemented here
we shouldn't be able to make it here
It's DieEnd, right
It's being made
There's something wrong
Maybe a typo
Ah I misspelled it
It's Notify, but there was a typo
We'll change the name like this
Like this
Execute it, and let's see
And when we implement it like this
the AnimNotify_DieEnd node earlier
shouldn't exist in the animation blueprint
It will cause error
So you need to check that first
Here, there's an error
The error here
It's implemented in the code, so you can't use it here
That's what it means
Delete it
Execute it and see the results. Bang, bang
After falling, it goes down like this
I'll summarize the content learned in this unit
Changing the appearance of the enemy and synchronizing C FSM and animation FSM Changing the appearance of the enemy Edit the data path and size of the enemy's appearance in Enemy.cpp
Create animation blueprint and select vampire_a_lush_Skeleton, then name it WBP_Enemy
Create the FSM state machine, then add Idle, Move, and Attack state motions Connect the transitions of state motions and set the conditions that fit each transition
Synchronizing C FSM and animation FSM Declare the variable that will remember the animation blueprint being used in EnemyFSM.h
Create Attack Notify in the animation sequence editor of Mma_Kick Add the AttackEnd Notify node in the animation blueprint editor of WBP_Enemy
After declaring the function that processes the attack time and the end time of attack in EnemyAnim.h, then add the implementation in EnemyAnim.cpp
Attack and death animation sequence configuration Attack animation Select vampire_a_lush_Skeleton as the new Animation Montage and name it Montage_Enemy
Add 2 attack animations and set it as Damage0 and Damage 1 After adding DamageSlot, select DefaultGroup.DamageSlot as the slot that the Montage will use
In the AnimGraph window of WBP_Enemy, add the [DefaultSlot] node and connect FSM to the Source input data part and connect the result to the [Output Pose]
Create and process the function for processing the attack animation play
Death state animation Add the Zombie_Death motion and add the Die section Process the death animation play in EnemyFSM.cpp
At the part where the death animation ends in Enemy Damage Montage, add DieLoop Notify Event and process it so that DieLoop repeats