O'Reilly logo

Unity 3.x Game Development Essentials by Will Goldstone

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Making the mini-game

To put into practice what we have just looked at, we'll create a coconut shy game that ties into our access to the outpost. By playing the game, the player will be rewarded with the final power cell they require to charge the outpost door.

As we have already set up the power charge element of the game, we simply need to remove one of the power cells from the existing scene, leaving the player with one less.

Select one of the objects called powerCell in the Hierarchy panel, and then remove it with Command + Backspace (Mac) or Delete (PC).

Creating the coconut prefab

Now let's begin our mini-game by creating the projectile object to be thrown, that is, the coconut.

Go to GameObject | Create Other | Sphere.

This creates a new sphere ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required