O'Reilly logo

Practical Game Design with Unity and Playmaker by Sergey Mohov

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

Working with prefabs

In order to create multiple instances of a game object with the same components and properties, or access the same game object from different scenes, you can save it as a file in your Assets folder. These files are called prefabs in Unity and act like game object templates. To create an empty prefab, right-click on the empty space in the Project panel, then select Create | Prefab from the contextual menu. A new file called New Prefab should appear in the Project panel. Call this prefab Wall. Now create an empty folder called Prefabs and put the Wall prefab in this folder.

Right now the prefab is empty.

  1. In the Hierarchy panel, select the Wall game object that you created in Chapter 2, Unity's and Playmaker's User Interface. Click ...

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