This week I was editing and changing the previous made features as well as working toward the full the integration of the rats into the game proper. I had to rework the way the ghost moves to be done without the aid of navmeshs as well as ensure all the ghost's events could still work, many had been broken in the restructuring of the git/levels. I also had to make the rat spawner, have the rats spawn when we wanted them to, have the rats die, have the rats change after they died, and solve the host of bugs that showed up during that process.
Our restaurant level had been changed a lot during the week I was away so I had to go through and update things like the restaurant manager and the navmesh to make sure everything I did before could still work. An issue there is that with the addition of lighting the walls and ceiling of the restaurant were now static and being recognized by the navmesh agent for the ghost. This brought an issue to the forefront, how was the ghost going to move through walls while the rats wouldn't if they both worked off the same system? I had to scrap the navmesh agent portion of the ghost entirely and instead move him with vectors to accomplish this.
Making the rat spawner was a fun problem to solve. I wanted them to be spawning out of a crack in the wall rather than a Tom-and-Jerry style mouse hole. The way I found to get this done was Unity's "closed shape" component. This tool allowed me to essentially draw a 2d image directly into the scene for a gameobject. Now knowing about this tool I can't wait to find more uses of making clean visual assets within the engine. This component also solved a problem of drawing an arrow on a sign in another level that one of my teammates were working on.
I had an annoying issues when making the rats die as the living rat wouldn't disappear when summoning a dead rat. This caused living rats, upon there death to rapidly spawn dead rats rather than disappear and only create one. This was because I had type Destroy(This) instead of Destroy(This.gameobject). It's a small mistake that I feel I've already made before but it was frustrating not knowing what was wrong. Now I know that the 'This' call is in reference to the script component and not the thing the script is attached to.
My next goal is to hopefully implement the fear feature for the player. Hopefully that goes well.
Did you like this post? Tell us
Leave a comment
Log in with your itch.io account to leave a comment.