The Tale of the Smidgen.

I am creating a BreakOut game in Unity using this video tutorial.  I need to do this because I gave my students the same tutorial to work through.  (Usually I proof tutorials before I assign them but since this was from Unity I figured it would be good.  Always a risk.) I had the thing done and went to test it and my paddle and ball were self destructing at the start of the game.  I think immediately I made a typo in the one of the scripts. An hour later, nope. Maybe I attached the wrong script to an object.  Nope. Time to go home. My brain hurts. So this morning I dive into the code trying to actually figure out the logic of what could be the problem.  I am not real hot on Unity/C# specific coding but I can follow it enough to see what does what. I start blocking out code with comments and find what code is causing the paddle and ball to self destruct pretty quickly.  That code is supposed to be there and looks all correct. I can even figure the logic of the code and it has to be like it is. Now an ugly confuser here is the tutorial uses Unity 5 and I am using Unity 2018. Could this be a version issue?  I hope not because if it is I am toast. I ignore this and hope. So I have exhausted all the likely suspects and am sitting and staring and mumbling expletives. Back to figuring what the Unity is actually doing. The base of the BreakOut game is a trigger to destroy the ball and the paddle and reset the start point of both when the ball misses the paddle and hits the base.  When something hits an object that is a trigger something happens. That something is in the code. Something is triggering off the base to run the destruction code. I sits and stares some more. Then there is this brilliant flash. (Different from a flash of brilliance). The walls of my game are sitting on my base. The walls are triggering the destruct sequence. I drag the base down a smidgen and no more self destruction.  I am an idiot. I continue with the tutorial. In the next piece of the video he has the same problem and moves the base down a smidgen. I am convinced I am an idiot.

The good out of all this is I now understand the code and the logic of the whole game much better.  One of the big issues with tutorials is the habit of following them mindlessly. Type but with no understanding of what is being typed.  I am fairly good at pausing to understand before continuing but after an hour of a tutorial I get more mindless than my usual mindlessness.  

Video tutorials are great.  A huge percentage of my programming knowledge has come from video tutorials.  But sometimes they just make your brain hurt.

Advertisements

2 Responses to “The Tale of the Smidgen.”

  1. Clark Scholten Says:

    So true! My biggest headache with game design is that many of the videos, tutorials, and books out there are based on a particular version of Unity. Trying to use the tutorial means that you either come up with workarounds or else get part way through and hit a point where you need to give up.

    I like the engagement of the students in the class but am not offering it again next year.

  2. gflint Says:

    I am hesitant about the Game course also but I still think the interest shown by the kids makes it worth the time and trouble. Each year I get a little bit better and the course gets a bit more defined. And besides, I think it is fun and gives me a break from Python and Java. It is an excuse for me to play and keeps me from teacher burnout.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s


%d bloggers like this: