Making our Moss Giant Move between two waypoints

Since we now have an proper understanding of what Abstract classes are and how different classes and inherit their properties, we can apply these functions to set up our enemy AI system.

Objective: Using the knowledge which we have gained about Abstract classes, we will apply them in our enemy…

Creating Enemy blueprints

Now that we are working with our enemy game objects and since we are going to be using several different types of enemies (ie. Moss Giants | Giant Spider | Skeletons) rewriting the scripts several times over is not the most optimal method. …

Making the camera follow the player

There are several ways in making the camera follow the player, the most simple way is to drag the camera game object and make it a child of the player component but that leaves much to desire, especially since Unity has implemented special features within “Cinemachine” for better camera control.

Setting Up Cinemachine:

Creating an swing effect for our player attack animation

Now that we have our swing animation, we can spice it up by adding some visual effects during the animation sequence. We will be working on how to create an new animation state and working with the player Animation script to toggle the animation trigger.

Arc Effect Setup:

Adding Attack Animations to our Player

For this article we are going to add an attack animation to our player and also learn how to toggle the animation via “Trigger” parameter.

Objective: Adding an Attack Animation to our player

Player Animation Setup:

Once you have slice and divided the animation sheet into individual frames, create a new animation clip…

Adding the Jump Animation to the player

Now that we have our flip mechanic completed along with the move and and jump mechanic finished, it is time to add in the Jump animation to our player. We will also be learning how to create select certain frames to smooth out the jump animation.

Objective: Add an Jump…

Flipping your 2D Player left and right according to direction

If you have noticed from the previous article that when the player moves towards the left the sprite is still facing left. In this article we will remedy that by using Unity’s new method of flipping the sprite left and right according to the direction the player is headed.


Creating a Running Animation for our Player

Similar to how we created our Idle animation for our player, we will be following the same steps to add our running animation. We will also be scripting when and how to toggle the animation to play and when to switch back to idle when the player isn’t moving.


Creating the Idle animation for the player

Now that we have our player basic functions down, it is time to add the flare of Animation.

Objective: Add and set up an Idle animation to the player

Player Prep:

First we need to bring out the Animation window in Unity, go to Window > Animation > Animation.

Adding Speed to the player movement

Now that we have optimized the jump mechanic we can proceed to adding faster speed to our player movement.

Objective: Adding a speed variable to our player movement

Player Script:

Start by giving an float handle for the speed variable. Then we are going to apply the speed variable to our movement…

Simon Truong

A Designer, an Illustrator and a massive tech geek aspiring to become a professional Unity Developer.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store