top of page
How to activate the animation of movements
image.png

Now, in order to set the animation for all the movements, we have to go to the blueprint file for the animation and select a page
Animation and we have to do the following:

1- Left mouse click and create a point (new state machine) we call it all animation and link it with output animation

new state machine: It is the point inside which all animation related software resides.

image.png

2- Orientation inside all animation, then we extract from the output point (animation state)

image.png

state: is the type of action to be performed
Now we need to make that state the idle state and the run state together, so we have to start by changing the name from state to IdleAndRun, and then we have to do the following:

image.png

When we go to the state (IdleAndRun), we will find the output animation and we have to write the points (nodes) that will make us do the animation.

We previously created a variable that allows us to call player data within the event graph page

image.png

3- We have to drag the variable as bp char into the state

image.png

3- We have to take the speed of the character and the direction of its speed, and that is by bringing the two points from as bp char:
get velocity: to get the character's velocity
break vector 3f: dividing the speed directions in all axes, we will only deal with the X axis because the character will only run left or right

image.png

4- We have to bring the not equal point from the X axis

image.png

5- We have to bring the point select animation by bool and it can be shortened by typing in the search box
(blend)
select animation by bool: Makes us choose which animation to run if the code is true or false

image.png

6- Now we have to choose which one will work if the code is true or false
Of course, we will choose play run if the code is correct, because the character's movement speed will be zero
And in the case of false, the character must be standing (idle) because it is equal to 0.

image.png

7- We connect them to the output, then compile

image.png

When we start playing, we find that the animation does not work, because we must specify the source of the animation for the character to receive them all, and we can do that:

1- Go to the blueprint bp_char and click on animation component and select the animation library that we want to use, which is animation_bp

image.png
image.png

2- Press compile and start playing. Thus, the running and standing animation should work

We did an animation for the wilderness but we didn't do a special animation for the fall. To create a fall animation, you must do the same steps for standing and running.

image.png

We call it char_blueFall and put it in the flipbooks folder

image.png

We put it inside allanimation, call it fall, and choose the char_blueFall animation

Go to the allanimation status page and do the following:

image.png

1- From the idleAndRun state, we extract a new state and call it jump. From the jump state we extract a new state and call it fall

image.png

2- In the jump state, we put the point play jump
3- In the fall state, we put the play fall point

image.png
image.png

There is a transition rule: it is the reasons (software) that make the character move from one state to another, so in order to move from a state of running or standing to a state of jumping, we must do the following:

image.png

1- Pressing the transfer base between standing and running and jumping

image.png

2- Bringing value to personal data

image.png

3- We bring the point is falling from the character as bp char, and we connect it to the output result
is falling: means that the character is not on the ground, and if it is not on the ground, it means that it is jumping

image.png

Now, in order for the character to move from jumping to falling, we have to do the following:
1- Go to the transfer base located between jump and fall

image.png

2- We have to recall the value of the personal data, its speed, and the direction of the speed

image.png

This time we only want to control the direction of the speed from the Z axis, which is the upper axis that relates to the jump

3- We put the point less because when jumping and the value is less than 0, this means that the character falls

image.png

Now we have to make the character fall back to the idle state and to do that:

image.png

1- Connect from point fall to point idleAndRun or vice versa, it does not matter from where you start connecting the connection base.
2- When going to the delivery base, we have to bring the value of personal data again

image.png

3- We have to create the point is walking
is walking: means the character is on the ground

image.png

4- Click compile and start playing

bottom of page