Commit often, commit often, commit often!

KT
2 min readDec 8, 2020

This morning I was SOOOOOOOOOOO close to getting my multi-level shields done. And then I made a fatal error. I moved a file in the Unity editor! Looking back, I can’t believe I thought this would be OK. How many times have I already learned this lesson? Two HARD rules of Unity:

  1. Never, under any circumstance, change the names of files once they are created.
  2. Never, under any circumstance, change the location of files once they are created.

Note: These may not be actual rules of Unity, but at this point in my learning, they are MY rules as I have no idea how to fix errors that occur from either of these actions.

I do not know where to access the code that connects these GameObjects together. I would think that if Unity assumes the responsibility of linking game objects together upon creation (and doesn’t not let me do it, which I would prefer), that it would also assume responsibility for updating the file paths if/when locations of files change! I do not understand this.

Another rule I did not adhere to:

COMMIT OFTEN!!!

Commit often, commit often, commit often.

Because I did not commit since I implemented my ammo/ammo powerup/ammo display, this is the last working code I have and therefore, this is where I must start from… again.

Since I’m starting over completely with the shields, this is my newer and easier plan of action:

When shield powerup is collected, instantiate a shield that can absorb three hits. Each of the three strengths of the shield will be indicated to the player by color of the shield.

As demonstrated below, I have a shield which, at full power is a light blue. Then, when damage is incurred, switches to a radioactive green and then when it’s on its last legs (lowest strength), changes to a deep pink/purple. I used the RGBA format for color.

Full strength shield is blue, med green, low strength purple.

--

--