Pt 7: Zombies, Zombies, and Zombies Galoure!

2 0 0
                                    

08/30/2023 - Soooo I did it again somehow... I broke my game...

Let me explain. I've been working on implement the zombies into the game. No, not just the test dummy cylinders, but actual zombie models (bless the Unity Asset store). Actually implementing them took the better part of a day of getting animations to work. Getting them to work was no small feat.

My goal for the zombies is for them to approach, stop, attack. If you are where they attack when it goes off, you take damage.

Approach was already implemented and looping walk cycle was... tedious but working. However if the player was in the attack circle where the attack would hit, the game would almost treat the circle as if it were a physical object and start making the zombie rotated around the player - even when the cylinder was set to be a trigger specifically.

Eventually I got it working, I don't even remember how, a lot of trial and error. Tried to implement light screen shake on getting hit... Camera moves wildly because of how I have the camera set up - so instead the screen flashes red.

So at least zombie is working!

So now I was like, lets set up a wave system like Call of Duty Zombie's mode, surely it can't be difficult.

Basically I set up a bunch of spawn points, saved into a transform array, then realized... Oh yeah, if I try to have the zombies spawn from these randomly, they may spawn halfway across the map. So I came up with a great idea, have the distinct areas set up as rooms, when a player enters a room, the roomValue int changes to that value and only a set of spawners associated with that value start to work.

Tested with room 1, no problem.

Went to room 2, pushed the wave start key to test it... Nothing...

Sat for about 5 seconds and remembered that I never set up the script to spawn for that room, went back to the Room 1 area to test the key again... Game froze.

Turns out in testing I had pushed the key like 10 times, and when the game went to room 1, it just spawned every damn zombie it could associated with the key presses.

Crashed unity for a 2nd time! My debug basically told me that it spawned 1047 zombies all at once.............

Oh, and in testing right before I tried the spawn mechanic... For some reason my bullets stopped launching, so I gotta figure THAT out again.

Zombies and the One Hand Army - Dev LogsWhere stories live. Discover now