Hello, this is Younghoon Lee
In this lecture, we'll apply player animation
In this lesson, you will learn how to control the player's animation
You will learn how to download animations from the marketplace
Retarget them, and apply Animation Blueprints
To build an animation state machine
We'll also learn how to use Blend Space
To smooth out player movement animations
This time, we'll try animation
To animate the main character
Please open Unreal Launcher
When you look here, there's a Marketplace at Unreal Engine
In the Marketplace
There is an Animation Starter Pack
If you do searching
You will find this
I will add this to the project by clicking
Select 'Show all projects'
Now, our project is cpp_tps
But version 5.3 is not supported
So, I will change it to version 5.2 and then add this
The capacity is not that big, so it is downloaded quickly
When you see the project
You can find out that the Animation Starter Pack folder has been is added
But this is an animation based on an asset used in Unreal Engine 4
So, we have to change this for Unreal Engine 5
I'll do that work
First, I'm going to make a folder to add the animation
Under the content
At New Folder
I'll make a folder named animations
I'm not going to use this as is
I'm going to transform it this way and then delete
If you take a look, you can do filtering
Here, from the Animation section
There's an Animation Sequence
Here it is
If you click on it, only the Animation Sequences will appear
In Unreal, one animated movement is called an Animation Sequence
So, the Animation Sequence refers to this one action
Like this
Press ctrl + a to select all
Then right-click here
There's something called Retarget Animation Asset
If you select this, there is also a duplicate
Please click this
Now, this menu will appear
I will click on the IK Retargeter here at the top left
Because I will change 4 to 5
I will select the second menu
Now it comes out like this
You can do it as is, but since I'm using a Quinn
I'll change it to Quinn form and proceed
After doing this
You can then select the folder
Press Change to make it look like this in the Animation folder
And press the Retarget button
Then, all of them have been retargeted
So let's save them
And open one to check
If you do this, you can see that the Quinn character
In Unreal 5 is animated like this
The animation startup pack has overlapping names
Which can be confusing
So I'll delete this
Press the Delete key to Force Delete
Now that we have the animation we want to use
Let's use it to process the animation movemen
Go to the Blueprint folder
And open the Protagonist Blueprint clas
As you can see, the animation is
Ultimately done by the Mesh that represents this Mesh body
If you look at the details after selecting Mesh
You will see something called animation
The animation mode is in the animation category
And the class is like this
If you look at it, it is a blueprint
But if you use the S set, you can reflect the animation immediately
For example, he will be in an idle posture
So if you select this, he will be in a posture holding a gun like this
You can control it like this
You could produce it by replacing all animations
One by one with ones that fit the situation
But this wouldn't be very efficient
So, rather than this, we will try to control it using the blueprint method
Let's create an animation blueprint and place it here
Since it is a blueprint, I will create it in this folder
If you right-click, there is an animation
In animation, there is something called an animation blueprint
I'll click on this to create it
Then, we will know what to make of the skeleton
If you look here, there is a third SK mannequin
The bone of the character we use now
It's a skeleton
I'll choose thi
And create
The name is Animation Blueprint, so I'll call it AB_
Since this is a TPSPlayer
I will write it with the same name
Since it is an animation blueprint, should we call it ABP?
Now, ABP_ let's do it like this
Then double-click on this, and it looks like this
If you look at these structures
There is My Blueprint on the left
And here is a place called Event Graph
If you double-click here
Yu will see a space where you can do the visual scripting we have been seeing
AnimGraph can be thought of as a space where animation sequences are placed
If you go here and look at the animation on the right
You will see an asset browser, if you look here, you will see a list of things you can enter here
Here, I will first introduce the idle posture
e will use Idle, Rifle, and Iron Sight as the default actions
Just connect like this
You can see the compile here
Click this or the one at the top to compile
I guess I made a mistake
With this
When you compile like this, you will end up with this posture
Save it
Next, we will assign this animation blueprint to the main character
If you click here and select ABP_TPSPlayer to reflect it
You can see the basic operation like this
It is structured very simply
Let's continue the animation using this
Let's go back to the Animation Blueprint
This reflects only one animation
But instead of doing this, we will try to control it using a state machine
If you right-click here
This menu will appear
If you say state machine here, it will look like this
I'll click on this and make it like this
This is a state, should we call it FSM?
Since we will move this, let's name it moveFSM
And delete it
Since the results appear here, I will link them like this
Since there's nothing right now, I'll just do an A pose like this
I'll double-click and go in here, and I'll take out the basic pose from earlier
And connect it like this
When connecting, instead of putting it in the center here
You can connect it by hovering your mouse over the white border outside here
We learned about state machines
A
This is the content
You can think of this as a state
Which means transition
Entry means starting now
And once it starts, it transitions to this direction and does this animation
Then it will work like this
To control this
Let's add more animation
If you look here, you will see a walking motion, let's call it walk
Then there are four walks like this
Iron Sight has four walking movements: forward, backward, left, and right
We will use these to process them
Shall we just try the front and back first?
I will put two things: Forward and Backward
For now, shall we just try moving forward first?
If you hover your mouse over it like this, it will turn white
Then, in this state, if you press the left mouse button and pull it like this
An arrow that allows you to transition will appear
You should be able to send it this way
And return it even if you turn in the opposite direction
I'll handle it like this
We need to create conditions to handle this
The thing that looks round over there is the condition
If this condition is met, it will transfer in this direction
Let me try it like this
If you look here, you can create a variable
Let's create a variable
In this way, we will create a variable called speed
And it will be of type Float, not Bool
So, how are we going to do this? We're going to do it with this concept
If we manipulate the Player and press the W key or something like that, it moves forward
If you look at it from the side, when the Player is like this, if you press the W key, it will move forward like this
So, let's take a quick look at Player
To see how fast this guy goes
If you look at Character Movement here, there is information about walking
Here's the magnitude of the movement
There is a value called work speed
Which moves at 6m per second
If we talk about it based on that
Velocity is created, and when you press the w key, velocity is created
And there is velocity
The direction of which is forward
And then the speed becomes the work speed and becomes 600
This is the structure
Speed ​​means the direction is removed, and only the speed value is returned
And speed means it only brings size to the front
Let's name it this
If we come back and look at the speed conditions, the speed will be 0 when standing still
And being able to walk means that your speed is greater than 0
However, since it is a floating point operation, we will use the Float type now
As for the Float type, floating point operations have some errors
For example, something like this
Even if we specify it as 1, if we calculate it internally
It may end up as 0.99999
This can be said, it is the same as 1
The Float type has this error
If you're curious about this, try searching for floating point operations
Just take a look at the error
That's why we'll do it this way
Rather than saying that this speed value is greater than 0
We will create a section of about 0.1, looking at it this way
If this is 0 and this is 1
This will actually be +600
Because the speed is 600
Then, if I'm standing still, it gives me a section around here
Rather than 0
I want to give it 0.1
But if it is less than 0.1 or greater than -0.1, it is just standing
I want to set it like this
Then, since this error is calculated slightly here
We can ignore it and proceed
So, I'm going to give a condition here
And if you double-click on it, you can enter it like this
Let's take out the speed here
Specify that
If it is greater than 0.1
It means walking forward
Compile
Come back, and click here to come back
What returns are when you double-click
When the speed is less than 0.1
I want to understand that it means stop
Let's call it less and call it 0.1
You can specify it like this, right?
Next, we need to actually add the speed
And here's a preview
You can use this to test it
The speed is listed here, right?
If you write 600 here, it will walk forward
If you write 0 again, it will stand still
However, looking at the animation, it seems like the idle posture is repeated
But when I write down 600, walk and stop
I think this is because it is not repeated
So, let me take care of that
If you double-click this
And look at this animation, if you look at Details, there is a Loop Animation at the bottom
Let me check this
I will just do Idle as well
Do this and then walk forward, right?
After selecting this, we will check Loop Animation
If you enter a value of 600, it will continue walking
You can set it up like this repeatedly
And let's try it on the other side
Please make arrows here as well
Next, the condition to stay still and walk backward will be
When the speed becomes less than -0.1
So I'm going to go with small, negative
If it is less than -0.1, you can understand it as walking backward
When it comes back, you can understand it as having become bigger than -0.1
This is how the speed increased
It will now stand in place if it becomes greater than Greater -0.1
I'll configure it like this
Then, when I say 0, the speed stops
When I say 1, it walks forward, and when I say -1, it walks backward like that
You can control it like this, and you will also need to modify the animation for this
Like this
Oh, my mistake
I'll select this and check this Loop
Preview is literally, preview
Modifying this value does not mean that the speed value here will become this value
We need to process this speed value now
But let's try controlling it in the blueprint first
If you look at the event graph here, it looks like this
If you look here, you will see that the name Owner is used
Owner means it owns this component
Also, this is not component, it's Animation
It is called Anim Instance
The Parent Class is said as Anim Instance
So, at last, Mesh has the Anim Instance
The Mesh Component has it
This has a Mesh Component, and it is the concept this character has
When you see here, it is said, Pawn Owner
I'm not talking about the Mesh Component that owns this
But the Pawn that owns the Mesh that owns this animation
After importing it
I will verify it
Because it may not exist
Because, to process this in Unreal Engine
This is also created and configured on this editor
As a result, an error may occur here
So, I will check this with IsValid
You can do this
You can think of this in the same way as Null Check
To be precise, it is a concept that checks sleep more powerfully than the null check
But you can do it with this
If you check it like this
And it is valid, you can use it
This can get velocity from the Pawn owner
Get Velocity, like this
So, let's put the value here into the speed like this
I will set this
If you get the vector length
Called length here, you can get the size of this vector
Let's put this in speed first
Do this and compile
Then, let's run it here and get it moving
Then it walks
Even if you go backward, it looks like you are walking
Like this
I just brought up the speed like this
But I didn't do it accurately
Because bringing about speed means bringing about the speed of velocity
This is what it feels like when you see it from the air
We can move in the direction of our arms
If you press the WASD key and if this is the front
If it goes like this, you only pressed W
If it goes like this, you only pressed D
So if it goes like this, it's like pressing W and D at the same time
If you press them simultaneously like this
What is the speed?
It might say 600
But it can be a little ambiguous
So, I want the speed value for exactly the front
And then some value going to the side separately
I mean
Look
When I run it here, it does a walking animation even if I move to the right
Even if you move to the left
When going forward, backward, right, left
It happens like this because they have velocity values
Of course, it only moves from front to back
So there is no big problem if you do this
However, the final form we will do now
Will include left and right movement animation
Then, we need to know the speed values ​​not only forward and backward but also left and right
So, I'm going to separate this a little bit
So, let's create one more variable here
Called a direction
Now, we are going to create two-speed directions like this
The meaning of this is that this is a variable that contains the size of the movement back and forth
And this is a variable that contains the size of the movement left and right
You can understand it like this
So, how do we get that ingredient out of Velocity?
I'm going to learn about that in a bit
Now, we can do that using vector multiply
We can process it using the inner product
It means that we will use a product in a vector
In a broad sense, the product has an outer product and an inner product
This time, we are going to do inner product
The inner product is a dot, and is expressed as a dot like this
Dot Product
This is Dot Product
Then we're going to do a dot
Let's say there's a vector like this
And two like this
Vector dots are written like this
In this way, we write the vector like this
If we express this again, it is a vector, so there will be a, b, and c
There will be x,y,z
Then we have x in a times b by x
Then multiply a by y and b by y
Then add again and multiply a by z and b by z
So, this is actually a float value
So, as a result, this value is a float value
This is now the Dot Project
And the concept of doing this is like this
Let's say this is a and this is b
Then, it's a little crooked right now
But if I just call it b, it's 0,0,1
This is also 0,0,1
In this order: x,y,z
Then, if you substitute here, it becomes 0,0,0,0,1
So what is the result of this?
If you multiply it like this, of course, it is 1
So, vectors in the same direction result in 1
So, let's look at the vector that looks like this
Let's dot a vector that looks like this and a vector that looks like this
If this is a and b
Then 0,0,1
And then this is 0,1,0
Because y is 1, right?
Then it will be 0 times 1 times 0
So how much is this
It's 0 plus 0 plus 0
So it is 0
So, something vertical like this is a right angle like this
If you dot two perpendicular vectors, they are 0
I'm talking about 0 and 1 because when the length is 1, like this
When the length of the vector is 1
There's one last thing, right?
The opposite side is like this: the opposite side of 180 degrees
The opposite side, 0,0,-1
This one is 0,0,1
Then, if you substitute here, it is 0,0,1
Which is 0,0,-1
Multiply this
Add it all up
Then this is 0, 0, and this is minus 1
So it's minus one
Here, if it's in the same direction, 1 comes out
When you do a dot, if it's perpendicular, 0 comes out
And if it's in the opposite direction, minus 1 comes out
What dot is
With this, I usually just find the angle
I can prove this
Or express the inner product like this
When you say a.b
If you write it like this in a, it means that the length of this vector called a is a scalar
Multiply b by the scalar
Multiplication is usually cosine
We don't express multiplication, but we express it here as cosine theta
Then, if the length is 1, this is 1 times 1
So this disappears, and only the cosine setter remains
If you were to prove this by drawing
A picture of the cosine setter, it would look like this
This is what cosine looks like
If you search on Google for something like this, you will find it
If this is 0, minus 1, and 1
Then it comes out like this
Then it goes up like this
And then like this
It has a wave shape
And the other side is like this
So how much is this?
This is now
2 out of pie
And if it goes like this, here's where minus 1 reaches
This is pi
Usually, this is pi we know now
It comes up a lot when talking about radians
But when expressing a circle, when we find the angle or circumference of the circle
We can call this the radius
And usually, when we talk about angles, we talk about two things
There are degrees, and then there are radians
Degree refers to 360 degrees from 0 as we know it
And radian means that
If the radius is R
This much of this circle here will be R
This is R, the length of R will be the same
Here, we do it like this
This is now 1 rad, 1 rad
So, when you turn it like this
You can say how many rads it is
When you say pi radian, it is 180 degrees
90 degrees is 2 minutes of pi
And 180 degrees is pi
So, we can express it like this
But in the end, this is 90 degrees
And 180 degrees
So, what is cosine 90?
It's 0, cosine 90 is 0
Cosine 0 is 1
A cosine of 180 is minus 1
With this concept
So it's the same as this
1, 0 minus 1
Right? 1 0 minus 1
This is 1, 0, and minus 1
Right? Depending on the angle
This is where the angle increases
So if the angle is 0 degrees, it is 1, if it is 90 degrees, it is 0
Ad if it reaches 180 degrees, it is minus 1
So you can see the same result as this
Anyway, if you use this vector's dot product
To this dot product
If there is a reference direction like this
You can multiply the reference direction by another vector
And dot it to find the same direction
Or the opposite direction
I'm going to try to use this to get it
I said this now means the front
So, just dot the front vector
And the forward vector
So here we have Get Forward Vector
On this Pawn
Vector Forward Vector, here it is
Dot the Forward Vector and this Velocity
It's called Dot
Dot Products
Then, a float value appears
You can put this here
And we'll bring the direction like this
Do this Velocity and Right Vector
and do it this time
So I will take this Get Vector Right Vector
Bring this
And dot these two
Just dot it like this and insert it
I am currently working on Blueprint
But I will try to do this again in C++
If you do this and run it
It walks like this when moving back and forth
But the animation does not work when moving left or right
You can see the results like this
Well, this time, we're going to make a jump
here needs to be an animation
to make the jump happen
So, I prepared a jump
And I'll try using it
So, an animation folder here
It seems a little awkward to put together
So, I will create another folder
Under the animation folder
This is called a jump
I'll put it here
This is filtered now
But I'll turn it off
I'll return it to its original state
In the Jump folder here
I'll put the player jump like this
Then ask this
What Skeleton are you going to use?
The jump I prepared now is
Probably also for Unreal 4
So here it is
Not this one, but the one below
Select this
And we are going to import this
But if you do so, you will probably get an error
So, if you open Advance here
There is a Snap to Closer Frame
Like this
Please check this
I will import it like this
Then, the animation was imported like this
Then, the animation looks like this
We will retarget all of this as well
What we are doing now is retargeting
So, use a retargeting animation asset
Duplicate
After specifying it
In the same format as before
This is asking what you want to do with the preset now
So you don't have to change it
But I'll do it together while I'm doing it
Select a folder
And then jump
This, too, is a bit ambiguous
The names would be the same
Let's just put it in the animation folder for now
Let's do this and do retargeting
Then, the animation would have worked well like this
Looking at this
It seems to be working well
Then, I will delete the jump that I placed below
In this way, we have now secured an animation
That allows jumping
So let's come over here and go to
Move FSM in AnimGraph
Then, there needs to be one variable
This means I will create a variable
To check whether I am in the air
We will do it with a Bool type
And we will call this IsInAir
You can name it IsFalling
It means are you in the air
So it feels like
I was moving and ended up in the air
Then you start jumping from there
If you look, there are three jump movements instead of one
They are in three forms: Start, Loop, and End
So, this will be a lunge before jumping
This is posing in the air
And a landing motion when it touches the ground
I will make it into three parts like this
So I'll arrange them here
If you say jump in an animation, it will appear
There are three here: Start, Loop, and End
I can handle this
But for now, I won't be using it in the end
I will change the Blend Space later
But I will arrange it
So it can only jump like this in the Idle position
Connect it like this
And it goes like this
So when it jumps, it'll start
When it's done, it'll do a loop
When it hits the ground, it does a landing motion
And then take the Idle posture again
I'll do in that way
Then, when the condition here is
Is In Air is True
It stays still while floating in the ai
And then becomes empty
This means that when your feet are not touching the ground
You perform a jumping motion
Specify it like this
Then, when this operation is over
It will automatically go to the loop state
If you select here
You will see the Automation rules of Detail, etc
So, if you check this
It means that when this animation is finished
The transition will be performed automatically
So, let me check this
And in the loop
It's empty in the air
If I say Is In Air is False
It's landed on the ground
It touched the ground
Then, it does the landing motion
So, for this condition
I'll put Is In Air
And put here when it is False
Then there are things like Not Boolean here
In this way
It is now in charge of changing True to False
It's Not
After doing this, I will put it in like this
And once this landing movement is over
It should automatically come to standing still like this
So, I will also check
The Automatic rule Base
Configure it like this
When we see IsInAir
Let's take a quick look in the preview
If you check this
It is here now
It is here right now
That's why it can't go this way
I will test this with the speed set to 0
If you check IsInAir, it will float in the air
And if you uncheck it again, it will touch the ground
In this way, you can now jump
Then, to jump
We need to do some processing
If you look here
What this guy has now is that
It has a Movement component
It would be the Get Movement component
But instead of this
I have to change that to a Character Movement component and use it
So, I used this as is
But I think I need to cast it and use it now
So, after replacing this with Cast To TPS Player
Let's do this last
After casting like this
Here's the Get Character Movement component
Here it is, I'll bring this
There's something called IsFalling inside here
With this
I'll fill this
Compile
If you run it, it jumps
Not when moving
Now that we've configured it that way
You can see that the jump works well like this
So, shall we try controlling this in C++?
Come over here
It's an Anim instance
Then, in Tools
Let's search for it here
Anim instance here
I'll create a class that inherits this
So this is the player name
So we'll call it TPS
Create
If you look here
We are currently working on this
In Blueprint Update Animation
So, the Player Anim's header looks like this
That's why it's called public
This is not a blueprint, so you can do it with a virtual update animation
Like this
The parameter is
Delta time
When looking for this, go to Anim Instance and search here
It looks like this
I'll just duplicate this and write it like this
In this way, you can create the implementation part by pressing Alt-Enter
I will write it right here
In the Blueprint, we created three variables earlier
We created Speed ​​Direction In Is In Air, right?
I'll make this
In here, New Property
Edit Anywhere
And create a variable like Plus Speed
However, to be able to use this in Blueprint
You must use Blueprint Read Only or Read Light
For now, we just leave it open
Let's add a Blueprint leadlight
There are three things: Speed, Direction, IsInAir
Speed, Direction
I created the Bool type IsInAir variable like this
I'll fill this in as I update
Let's go over here, and there are three things
Speed, Direction, and IsInAir
To do this, you first need to bring an owner
You can say try get pawn owner
You can use this as is
Then, what we will do with this is
Iit is a TPS player
TPS player
The automaticity isn't working very well
So, let's call it a player
Do casting
Let's add a header
Then you can use the player like this
You can get velocity from the player
Looking at this in Fvector
You will see a dot product
will use this to find the direction
And since this is now velocity
Should I create it separately?
Velocity with fvector
I'll do like this
fvector forward
This will be the forward vector
And there is also a right vector
For the right, here is the right vector
After doing like this
We will now do dots
Let's go forward and then dot the velocity
We will put this value in the speed
And do the same thing, this to the direction
And this is the right vector
I'll make sure to fill it out in IsIn as well
Here is the player's character movement
After we import this
We will fill in the isFalling value here
To use this, you need to add a header like this
You need to add this to the game framework
Like this to use it
And this shouldn't be done when the player is null
We will fill it only when it is not null
I'll check for null like this
Then, configure it like this
Then we need to change its parent
After doing this, I will compile it first
Now, to change the parent
We will change it to tps-play-anim like this
Then, the existing values ​​change like this
Which should now be deleted
Let's delete the contents of the blueprint here like this
I'm deleting all of this
The things that were processed at speed after
That will now be removed
Still, you created a condition here
If you look at it this way, the speed
Yes, the speed will be 0
So, I used find-reference, and it looks like this
But let's delete this first
Speed
If you delete this, you will get an error
If you do this, you can bring this here at speed
Get speed, and fill it out like this
It's here, too, copy it
And it's here, too, put it in like this
Fill everything out like this
And let's see if the direction is also being used
If you right-click and use find-reference like this
You will see that this is not currently in use
I think I can just delete it
We process it like this
When we return, it is reflected well here
Then let's try running it
Jump like this
It works, right?
In this way, we can use it interchangeably in C++
Then, finally
I structured it like this
But this is getting a little complicated now
This is just front and back
But adding left, right, and diagonal lines
Becomes difficult to process
So I'm going to create something to replace this
And I'm going to come over here and create it on the Blueprint
If you right-click and look at the animation
There is something called Blend Space
Click thi
Likewise, you need to specify the skeleton
Next, let's call this a BS_TPS player
If you write like this and double-click
To see here, there are two Horizontal vertical axes
You can unfold it like this
The name here is
Horizontal, which is our direction
It's called Direction
Next, the vertical is called speed
Like this
Then, this is the vertical and this is horizontal
Then, you can place the animation here
But let's do Idle first
Let's put Idle in the middle
But it doesn't fit well when placed
If you press Shift, you can place it exactly on the point
Let's place it while holding down Shift
After that, you say work
Next, I'll place this backward here
Forward
Left
And right
Then, if you press the Ctrl key
You can move the focus like this
I didn't click the mouse
If you move the mouse while holding the Ctrl key
The animation will blend like this
Mix it like this
Do the diagonal like this
Since it has this function
I'm going to give it a try
Do this and save
Then I came back here
And did this now
But I don't use this anymore
Here instead
I think I should process it like this
Let's create a node
It's called add state
Let's say move bs.
This is a blend space
Let's go here and look at this
This is the bs tps player we made earlier, right?
I'll write it down as is
BS_TPSPlayer
If you do this, it will come out like this
Shall we do the one on the top?
If you press this, it will appear like this
Bring our direction like this
Get direction
Get speed
And put it here like this
Like this
It is a variable created in C++
If you do it like this, it will happen like this
Then, put this in the output
And compile it
You will get something like this
It looks like this
After doing this, we returned
And did not use the existing content
Let's put this aside
And try this
Then we'll have to make this again
I'll cut this off
If you hold down Alt and click, it will hang
Arrange it like this again
The entry is also connected here
I'm not using this anymore
I'll come here and use this
Because this is a jump
Bring this back to IsInAir
And put it back in
Which is automatic
Automatically check it like this
After thinking about it
I think I made a mistake with this Blend Space range
This is direction 600 and -600
It should be done like this
Then for the speed
x to 600 and this to -600
Let's readjust the speed range
Please change the location like this again
If you hold down Shift and move it around, you can stick it like this
After configuring it like this
Save it and return it
To Blend Space, and if you do this
There are times when it is not reflected properly
So, let me erase it and reflect on it again
You can put the Blend Space here like this
Blend Space can be
Put it in like this
Please connect like this
Compile
Then, it will be reflected well
Let's run it
It seems to reflect well left and right, forward and backward
You can now jump while walking
Let us summarize what we learned in this lecture
Processing animation movements using Blueprints Movement state animation Add animation assets to the project and create the ABP_TPSPalyer blueprint
Transition is connected in both directions between [standby state] and [moving state] in each direction Connect the Float type Speed ​​variable to each [float] comparison node
Create a [Vector Length] node connected to the [Get Velocity] node and add the Speed ​​variable as a [Set] node
Connect the execution pin when the [Cast To ABP_TPSPalyer] node succeeds and the [Speed ​​Set] node
After adding the Direction variable, the inner product of the vector is used to process the forward/backward movement and left/right movement to be different
Jump State Animation After registering JumpStart, connect the [Idle] state node and transition
After declaring IsInAir, a variable to remember whether it is in the air, set it so that a transition occurs when it is true
[Idle] state node - [Jumpstart] - [JumpLoop] - [JumpEnd] - [Idle] State node connects transitions and sets conditions
Handling animation motion using C++ and blendspace Action processing using C++ Search for AnimInstance and create TPSPlayerAnim as an inherited class
Copy the function declaration to the TPSPlayerAnim.h file and override it Enter BlueprintReadWrite as a UPROPERTY specifier so that it can be used in blueprints
After declaring Speed, Direction, and IsInAir variables, assign appropriate values ​​to each variable
Motion processing using blendspace After creating a blend space, name it BS_TPSPlayer
Set blend space axis values ​​in the Asset Details window Register [Idle_Rifle_Ironsights] in the editor grid window and place animation sequences for each direction
[MoveBS] After creating the state node, select Blendspace 'BS_TPSPlayer' to create the [BS_TPSPlayer] node
After adding Direction, Speed, and variables, connect them to Direction and Speed ​​of the [BS_TPSPlayer] node, respectively
[MoveBS] - [JumpStart], [JumpEnd] - Connect transitions in the [MoveBS] direction Register the IsInAir variable in the graph window and connect it to the [Result] node