Day 20:20

Frankie Rodriguez
4 min readDec 10, 2020

The bad mojo of 20 strikes again…..

In this section, I learned to create and build the different deployment options. To get started, I clicked on FILE to Build Setting. By default, it will set for PC, MAC, and Linux. For my purposes, I set my build to be compatible with Windows. For those with Macs, changing the platform is simple. Things to note: always check the player setting to customize the company name, product name, its version, and anything related to the build setting i.e full-screen mode exclusivity. One thing I did was customize the default height and width settings for the full-screen mode. When satisfied with my customizations, I clicked build and let it do its thing…which failed. After a few seconds, it gave up on itself and presented with this error message.

It took a while to figure out what was happening and why. Here are a few ‘solutions’ that I tried:

  • Moving C# Scripts into an Editor Folder: I thought maybe Unity was having a hard time differentiating the folders, boy was I wrong.
  • I Googled and Googled and Googled solutions until I was Googled out
  • Reached out to the Community: This was something I should have done first, but true to the male stereotype I needed to solve it on my own. In the #all-question-answer channel, Ryan Yamura was able to provide me with the solution. See below.

After I followed these instructions, I was able to build my game. Coming down from the high of fixing the build error, I faced another issue. When I ran my game.exe, the NEW GAME start button did not function….at all.

I began to think of possible reasons that could’ve caused this issue alas I was stumped. Why did the game function correctly on the Unity program but not on its’ own?

As the seconds went by I sat here losing all hope. Then a light bulb lit in mi cabesa. I thought to myself -“What if I put my C# Scripts back into the scene folder? Worst case scenario I’m back at ground zero.” After moving my C# scripts back to their original location, I recreated my build. After a few mins of praising and praying to the coding gods, I ran the game and did a happy dance. IT WORKED!

Once I completed the build, I went back to develop my game even further. Next on my list, develop the enemy’s ability to fire not one but TWO lasers. Like with everything else, I dragged and dropped the enemy into the Enemy Container followed by the laser prefab. Once positioned, I duplicated the laser and named them right and left. From there I created an empty game object, Enemy_Laser, then dragged and dropped the Enemy_Laser prefab. I then went on to instantiate the lasers. After running the game, another problem occurred: the player lost two lives when interacting with both enemy lasers. I didn’t know what to do, so I Googled. However, that got me nowhere, only more confused. Finally, I reached out to the community to help me get out of this pickle.

We pause momentarily to give a Shout-Out to Daniel Mann, another intern in this program for answering my call to help. Without his guidance, I would’ve sat here all night. Thanks for guiding and working through the solution with me, instead of just feeding me the answer.

Back to the regularly, long, scheduled blog reading….

From working with Daniel, I learned that I needed to create an ‘immunity’ logic. Here is my code and game:

--

--