O'Reilly logo

Unity 3D Game Development by Example by Ryan Henson Creighton

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

Time for action - prefabulous

Our game is going to contain not one bomb, but many. As with programming, doing something more than once in Unity completely stinks, so we're going to take a shortcut. We're going to create a built-in thing called a Prefab that will let us create a reusable bomb, much the same way we created a programmatic function that we could call multiple times in our script.

Follow these steps to create your first Prefab:

  1. Right-click/secondary-click the Project panel and choose Create | Prefab, or click Assets | Create | Prefab in the menu. A gray box icon appears in your Project panel, labeled new prefab. Because the box is gray, we know this Prefab is empty.
  2. Rename the Prefab Bomb. Just like the Spark Material, the icon helps ...

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