Zombie Progression Report: Enemy Prototype and new Player Character Unity 3D
Since last time (Zombie Progression Report: Player Movement & Shooting, I made a few features. Let’s get started
Enemy Prototype
For enemy movement, this time around instead of using AI Mesh Agent to tell the enemy where to go, we created the movement system from the ground up using the Character Controller component. You can read more about this system in details here (Character Controller in Unity).
The enemy will use a StateMachine. For now they have two states, a chase states where they chase the player, and an attack state where they start attacking the player.
During the Chase state, the enemy will find the player object, set him as target, and move towards him using the Character Controller Move() method.
Finally, I added a small health bar above the enemy using a canvas attached to the enemy object and its Render Mode set to World Space.
New Player Character
Using Filebase(a large unity asset database) I downloaded the Sarge. The Sarge is a military soldier who’s mission was to keep the city from falling down to the hoards of zombies. After all his unit was wiped out, he was left alone to survive and get out of the city.
The sarge main weapon is a UPS pistol that does good damage to the zombies.
For now the gun has a firing animation, an empty clip animation, and a reload animation.
Here is it in action: