Error Terror

Error Terror

When deciding between using Unity or UDK as our game engine of choice, one of my main qualms was with the error messages Unity throws at you. Whereas UDK will let you jump in the game with multiple kismet errors, Unity spits out lists of errors, refusing to let you run the game before fixing them all.

There are entire forums out there dedicated to dealing with various programming error messages. And as a novice programmer, this scared the heck out of me. How was I supposed to know what was wrong without seeing what my code did?

However, after weeks of braving the sea of error messages, I’m happy to say that I find them quite helpful. Most of the time. In fact, I even have a few favorites:

1. Error CS8025: Parsing error

This is hands-down my favorite. Easiest to fix, yet one of the most annoying. This error usually refers to a misplaced curly brace. Spend a few seconds visually pairing up all the curly braces, and this error is soon out of your hair.

2. Error CS1525: Unexpected symbol ‘{‘

This one is another fun syntax error, usually thrown out as a result of not pairing all the parentheses in conditionals. In programming, most things need partners.

3. Error CS0029: Cannot implicitly convert type ‘int’ to ‘bool’

There are several variations on this error, which usually results from syntax error in the conditional. Most of the time, I get this error when I forget to include double equal signs in my conditionals (e.g., ‘if (iLevel = 1)’ rather than ‘if (iLevel ==1)’), so the statement tries to set values rather than compare them.

From here, the errors start to get more complicated, ranging from null reference exceptions to invalid argument errors. And those are just the ones Unity can detect. Often, the most difficult errors to fix are those that result from faulty logic. It does exactly what you told it to, but unfortunately, your directions were off.

So what have I learned from the countless error messages Unity has thrown my way? Even the best programmers make mistakes that lead to error messages. But figuring out how to successfully deal with those error messages is what separates the good from the great.