60 days to become a game developer. Day 40.

Mar McRae
4 min readNov 29, 2020

Hi! Today is Day 40 of my 60 day challenge to become a Unity Game Developer!

I am almost finished with the game! Woot woot 🙌

Take a look:

All I have left to do is finish up a few more game manager and main menu components as well as clean up a couple of things. So far this game has been a little bit of a struggle for me. Getting the camera angles just right for the cutscenes was really tricky and time consuming and although I’m pretty happy with how they came out, I still feel like they could be a bit better. Going to try and work on that a bit tomorrow. The good news is that I learned soooooo much. Learning to use Cinemachine and Timeline showed me what powerful tools they are to be able to capture the exact cinematic style and look you envision for your game. One of the things I love the most about game development so far is the ability to really showcase your creativity and personality in your work. Very excited to use these tools in my own future games!

There was a lot that happened under the hood today so here is a brief summary of some of the things I worked on:

Creating the Animation for Guard Enemies:

In the animator a parameter was created to distinguish whether the guard should be playing its walking or idling animation.

Here you can see the conditions listed from within a transition between walking and idling.

Creating the “eyes” for my enemies:

  • In order to be able for the guards to “see” Darren, the main player, and trigger the game over scene a 3d object needed to be created as the base. By turning off the mesh renderer, the outline of a collider was left which was then used to detect collision via trigger. By making sure the trigger was set to true and a rigidbody was added, the desired behavior was achieved.
It doesn’t look like it but this is actually just a cube with its mesh renderer turned off.

Coin distraction:

  • The purpose of this section was to create a distraction to move guards away so that the player can sneak past. Darren throws a coin which makes a sound and all the guards rush over to check out what is going on. This is what’s going on in the gif above. In order to make this happen I needed to instantiate the coin. I also needed to add in the audio clips of the coin hitting the ground, the voice over explaining how to distract the guards with the coin, as well as the animation of Darren throwing the coin.
Animator showing transitions between Darren’s different animation movements. Unlike idle and walk, this throw animation was created using a trigger parameter rather than a bool since it would only need to happen once per game and can happen from any state.
The voice overs are triggered when Darren passes through specific positions on the board. By using a voice over script, we are able to dynamically reference each audio clip to its respective trigger point as shown above.

Security Camera:

  • There are security cameras that can also detect Darren’s movement and trigger a game loss. In this section, I got a refresher on how to record an animation from scratch by moving the object in the scene view whilst recording. After that, just needed to add in a mesh collider and rigidbody in order to detect collisions. Also added in logic to change the spot light from green to red if Darren is caught within the trigger zone.
Side note: For this animation I needed to adjust the sample rate and It took me a second to try and figure out where it was in the animation tab. If anyone else has trouble finding it, its listed under the hamburger tab in the upper right corner.

Sleeping Guard:

  • Worked on implementing the sleeping guard cutscene at the given trigger point.
Had some weird behavior with the cutscene not stopping when it should. Added in a Coroutine to deactivate the cutscene after 6 seconds.

Game Manager:

  • Learned about the singleton pattern which you create a blueprint in which you can use one instance for all classes. It works by using a static variable to access the class which allows for more code optimization and abstraction. Also added in the intro cut scene and its audio clips.
Here is how the singleton pattern was implemented for the GameManager class. One thing to note is that Unity cannot see properties in scene i.e. HasCard bool.

What’s left:

  • Work on main menu functionality.
  • Want to redo some of the cutscenes.
  • Need to fix the second security camera. Have very weird behavior where the camera appears to float off the wall and out the window.

Man, 40 days later, 2 games in, and I cannot believe there is only 20 days left from my original challenge date! It really is crazy how far I’ve come. I am really proud of myself for the progress I’ve made. Seriously can’t wait to see where I’m at by day 60.

See you tomorrow :-)

--

--