Revisiting Code

Today, I spent time fixing bugs, and the first one I noticed was once the player had reached the end of the level, if they pressed the escape key then it would un-pause the game and put the player at risk of dying to a zombie. To fix this issue I had to create a new script and place it on the door, meaning that now when the player walked into the door, it would pause the game (using a Boolean) and override the escape key from being able to be pressed. 

Another minor bug was that some of the keys were clipping through the floor, so I just raised them up. 

I had a few minor issues with enemies where you could climb them and if you collided with them it was causing them to constantly move away from the player. To fix this I added more mass to the enemies and applied a physics material called “NoStick” which prevents the player from being able to climb on the zombies.

The last thing of that day that I did was modify the aggro range of the zombies. I used a function to draw the aggro range of the zombies so I could get an idea of how far that range would extend. I’ve intentionally left the range quite big per zombie, as I liked the idea of when the player steps into range the zombie will start pathing towards the player, regardless of if there’s a wall between the player or not.


Comments

Popular Posts