Uploaded October 2020 | Updated September 2026, 3 weeks ago
#UnityAnimation
Episode 4. Create Enemy Run Animation For Among Us 2D Shooter Game Clone Made With Unity Software.
I play games here - twitch.tv/zzotoff
You are very welcome :-)
Previous Video
Fire Pistol And Shotgun Switching Them Back And Forth | Unity Fire And Switch Weapon Tutorial youtu.be/vmbZsbdqza0
Pre-Previous video
Give Among Us A Weapon Pistol & Shotgun | Game Clone Made In Unity Software | Weapon Switch Feature youtu.be/nDAZIKNx0wg
Pre-Pre-previous video
Among Us Idle And Run Animation Unity Software Tutorial | Top Down Movement In 2D Unity Game youtu.be/W3-EncfpBZM
Enemy Parts Here drive.google.com/file/d/14NLRBCV2NP_D0VrTO9dN22WzmeBDedfX/view?usp=sharing
Hi!
In this video I create a simple run animation for enemies which will be moving towards the player later. So here is my project created in previous videos. Link is in the description. In addition here I have an enemy body sprite sheet, enemy shadow and enemy visor sprites. Why are they all separate? Well, we’ll see a bit later. First of all I need to slice the enemy sprite sheet. Select it. Change sprite mode to multiple. Hit apply to apply the change and go to the sprite editor. To slice this sprite sheet I go to the slice menu. Automatic slice mode is set by default which is OK for me in this case. I hit the slice button and now I have 5 different sprites. Important thing here is that the last two sprites have different widths and different positions of their pivot point which means that animation will jitter while playing. To fix that I have to shift the pivot point for these two sprites. Y axis position will be 0.5 for both of them. The X axis position in my case will be the following. Of course, these values can and will be different in your or any other cases. So only experimenting with those pivot point positions will give you the correct values. OK. Hit apply to save the changes.
Now let's assemble our enemy. Body goes first. I rename this new gameobjects as Enemy. Scale it down. Here it is. Something is missing. I take a shadow sprite and put it into the enemy gameobject making it a child of the enemy. Now it will be following the enemy. Scale shadow down and put it right about here. Shadow is rendered in front of the enemy. To fix this I need to set Order in layer value properly. So I set this value to 1 for enemy and enemy is in front of the shadow now. Shadow has 0 here. Next detail is the visor. I put it into the enemy as well making it a child. Here it is. Scale it down. Set order in layer to 2 so it appears in front of the enemy. I position it about here. Ok. Now. Why the mother of god I make this enemy so complicated? That’s why. Making my enemy be composed of different objects I can change properties of these objects separately. In my case I can change the color of the enemy body the way I want it. So when a new enemy is spawned it will get it’s own random unique color. At the same time the visor and the shadow will keep their color tints. That’s the trick. Ok. Enemy is ready to be animated. Make sure the enemy is selected. Go to the animation window and hit create new animation button. Enemy will have only one animation which is run animation. Now I have to D&D certain sprites into the timeline creating a running sequence. Here we go. If it’s running too fast I can slow it down by reducing the number of samples here. Hit enter to save this change. Visor is not animated because it is a separate gameobject. So I have to animate it separately. Select the visor and hit record button to start recording an animation for visor. Here is the timeline for the visor. Here I will record position shifting for it. I alter Y position. At the first frame visor will be here. When the enemy changes its sprite I put the visor a bit down so it follows the body. Body goes up, the visor goes up as well. And so on. Works just f… What the… Ok. By default these keyframe values have sine-like alteration. That’s because the visor kind of floats. To fix that I go to Curves tab. Here are the visors values I just recorded. See this sine curve. That’s the problem. Select all of the key points. Right click. Both tangents. Constant. There we go. Fixed. Animation is done. Turn off recording. That’s it. Now I can duplicate this enemy a couple of times and give each of them a unique color. Spread them around the scene, hit play and enjoy this colorful crowd. I think in the next video enemies will be able to run towards the player.
#UnityAnimation
Episode 4. Create Enemy Run Animation For Among Us 2D Shooter Game Clone Made With Unity Software.
I play games here - twitch.tv/zzotoff
You are very welcome :-)
Previous Video
Fire Pistol And Shotgun Switching Them Back And Forth | Unity Fire And Switch Weapon Tutorial youtu.be/vmbZsbdqza0
Pre-Previous video
Give Among Us A Weapon Pistol & Shotgun | Game Clone Made In Unity Software | Weapon Switch Feature youtu.be/nDAZIKNx0wg
Pre-Pre-previous video
Among Us Idle And Run Animation Unity Software Tutorial | Top Down Movement In 2D Unity Game youtu.be/W3-EncfpBZM
Enemy Parts Here drive.google.com/file/d/14NLRBCV2NP_D0VrTO9dN22WzmeBDedfX/view?usp=sharing
Hi!
In this video I create a simple run animation for enemies which will be moving towards the player later. So here is my project created in previous videos. Link is in the description. In addition here I have an enemy body sprite sheet, enemy shadow and enemy visor sprites. Why are they all separate? Well, we’ll see a bit later. First of all I need to slice the enemy sprite sheet. Select it. Change sprite mode to multiple. Hit apply to apply the change and go to the sprite editor. To slice this sprite sheet I go to the slice menu. Automatic slice mode is set by default which is OK for me in this case. I hit the slice button and now I have 5 different sprites. Important thing here is that the last two sprites have different widths and different positions of their pivot point which means that animation will jitter while playing. To fix that I have to shift the pivot point for these two sprites. Y axis position will be 0.5 for both of them. The X axis position in my case will be the following. Of course, these values can and will be different in your or any other cases. So only experimenting with those pivot point positions will give you the correct values. OK. Hit apply to save the changes.
Now let's assemble our enemy. Body goes first. I rename this new gameobjects as Enemy. Scale it down. Here it is. Something is missing. I take a shadow sprite and put it into the enemy gameobject making it a child of the enemy. Now it will be following the enemy. Scale shadow down and put it right about here. Shadow is rendered in front of the enemy. To fix this I need to set Order in layer value properly. So I set this value to 1 for enemy and enemy is in front of the shadow now. Shadow has 0 here. Next detail is the visor. I put it into the enemy as well making it a child. Here it is. Scale it down. Set order in layer to 2 so it appears in front of the enemy. I position it about here. Ok. Now. Why the mother of god I make this enemy so complicated? That’s why. Making my enemy be composed of different objects I can change properties of these objects separately. In my case I can change the color of the enemy body the way I want it. So when a new enemy is spawned it will get it’s own random unique color. At the same time the visor and the shadow will keep their color tints. That’s the trick. Ok. Enemy is ready to be animated. Make sure the enemy is selected. Go to the animation window and hit create new animation button. Enemy will have only one animation which is run animation. Now I have to D&D certain sprites into the timeline creating a running sequence. Here we go. If it’s running too fast I can slow it down by reducing the number of samples here. Hit enter to save this change. Visor is not animated because it is a separate gameobject. So I have to animate it separately. Select the visor and hit record button to start recording an animation for visor. Here is the timeline for the visor. Here I will record position shifting for it. I alter Y position. At the first frame visor will be here. When the enemy changes its sprite I put the visor a bit down so it follows the body. Body goes up, the visor goes up as well. And so on. Works just f… What the… Ok. By default these keyframe values have sine-like alteration. That’s because the visor kind of floats. To fix that I go to Curves tab. Here are the visors values I just recorded. See this sine curve. That’s the problem. Select all of the key points. Right click. Both tangents. Constant. There we go. Fixed. Animation is done. Turn off recording. That’s it. Now I can duplicate this enemy a couple of times and give each of them a unique color. Spread them around the scene, hit play and enjoy this colorful crowd. I think in the next video enemies will be able to run towards the player.










