Chapter 37: Coding Challenges

Although this book has been very helpful in guiding readers and students to learn several aspects of Unity over the years, many of my students have had difficulty transitioning from the tutorials in the book to creating their own games from scratch.

This chapter introduces you to the Coding Challenges that I have developed over the past few years to help with that transition, and I will continue adding more challenges every year.

Coding Challenge UnityPackages

Note: By default, Chrome will not allow the download of any UnityPackage files. Google has marked all unitypackage files as “malicious.” To download this file, right-click it (control-click on macOS) and choose Save Link As… . This will show you a red exclamation point at the bottom of your browser window, but you can click the ^ next to that message and choose Keep to download the file.

Errata in Code Listing 37.2

  • Near the end of the code listing when setting pos.z the minimum value for the Random.Range() call should be repositionRangeMin.z (replacing repositionRangeMax.x).

    The entire corrected line should be:
      pos.z = Random.Range( repositionRangeMin.z,
               repositionRangeMax.z );