top of page
How to add enemy and animation

1- First we have to add the enemies and we can get the enemies from this link
https://zerie.itch.io/tiny-rpg-character-asset-pack
Then we import the Orc file that we downloaded into content in Unreal Engine.

image.png
image.png

2- Click on sprite actions then apply paper 2d texture settings

3- Now we have to create a file for each movement style and name the files after the character and movement style.

image.png
image.png

4- We extract sprites for all movement patterns in all files in auto mode.

image.png
image.png
image.png

5- We create flipbook animation for all movement styles.

image.png
image.png
image.png

6- Now we have to create a file called animation source in which we can save all the animations we want for the enemy (animationsource) and we call it allanimationorc

image.png

7- Now we create an animation sequence inside the animation source and place all the flipbooks that we created previously (idle, walk, attack1)

image.png

8- Now we create animation bp and name it animationbp_orc
paper zd animation bp: Animation control and programming (blueprint for animation)

image.png

9- Before we start activating the enemy animation and placing the necessary programs, we must create the character and name it bp_orc and set the default movement style to idle.
source flipbook: idle

image.png
image.png
image.png

10- Now we will follow the same steps to put the animation and control the character char_blue
Explanation in Lesson 8

image.png
image.png
image.png

11- Now we have to go to the personal blueprint bp_orc then to the event graph
We will create a program called a custom event.

Custom event: It is a conversation that we call at any time, and each event has a specific purpose.
We will make the custom event we created control the character's movement in the X axis.
So we'll call it
handlingmovement.

image.png

12- Adding the point (add movement input): Adding the movements that will work when the input is achieved inside the point. We have to change the X value from 0 to 1 so that the character moves in the X axis.
We put the value 1 in the X axis so that the character moves right and left.

image.png

Scale value: Controls the direction of the enemy.
So what we have to do now is create
a variable from the scale value so that we can save its value and call it anytime we want.

13- We left-click on the scale value variable and upgrade it to a new saved value and name it movedirection.
We put a check mark next to instance editable so that we can change the direction value at any time we want.

image.png

14- We will link the event ( event tick ) with the new custom event that we created ( handlingmovement ).
event tick   Works immediately upon startup

image.png

15- Now we have to make the character turn left.

15- Now we create an event called handling rotation.
16- We call the value we created movedirection to get the value of the enemy’s movement direction in the X axis.
17- We create a greater point, a branch point, and a set actor rotation point.
These points will briefly do the following:
The event will take the enemy's direction value through the movedirection value. If the enemy's direction value is greater than 0, the enemy will face right. If the enemy's direction value is less than 0, the character will turn 180 degrees in the Z axis.
Z axis is responsible for the direction

image.png
image.png

We click on the three dots and change the game mode to simulate so that we can see the changes and modify at the same time.
We change the movedirection value to negative and start playing so that we can see the changes.

image.png
image.png
image.png
bottom of page