Prefabs

Creating prefabbed GameObjects is a great way to keep your game organized, but it is also an important step for optimizing your game. Since Prefabs are “master” GameObjects that are reused throughout your game, using them lets you know there isn’t unnecessary data being added to them.

Prefabs can also be instantiated—spawned—at runtime. This means that they are not drawn, and therefore not used, until they are added into the game. This can help reduce the number of draw calls in a Scene because the Prefabs are loaded only when they are needed.

Get Learning 2D Game Development with Unity®: A Hands-On Guide to Game Creation now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.