Enemies are done!
- Gabi Zorek
- May 2, 2021
- 2 min read
I have been sooooo busy over the past few weeks! I have managed to implement all of the enemies. I decided to change the idea of the last enemy completely, now it has got an Enderman effect just like in one of my favourite games MINECRAFT!!
It works by having a sphere collider on the enemy, and when the player triggers it, the enemy will start to teleport around the player every 3 seconds and attack if they teleport close enough. I obviously did research on how to do this and I found a this on the unity documentation: Random.insideUnitCircle and I applied it to my code with a min and max value and it works! The effect is so cool because it gives the game a scary vibe.
The next enemy I got working is the Scorprobot which is the little scuttling enemy. The start chasing you when you are within a specified distance to the player. They will chase the player forever so the only way to get rid of them is to kill them. If these enemies get close enough, they will sting you and release a blue gas, both of these things will cause the player to take damage
The drone enemy was working perfectly, I just added more of them to the scene.
The next thing I sorted out was the grenades battery slider not increasing when the player has collected a battery collectable in the scene. I spoke to my tutor and I had the slider in two places at once and then when I figured it out and added the slider to the players inspector, and then I thought it wasn’t working again but I had to set a limit so when the player collected a battery collectable, it wouldn’t go over 100% because obviously it wouldn’t go down straight away in the slider until it got to 100%. So I just did a
if (currentBattery > 100);
{
currentBattery = 100;
}
And I did the same for the health. And the other way to so if its 0 then keep it at 0.

Comments