Unity Basics
  • Welcome
  • Getting Started with Unity Software
  • Helpful Shortcuts
  • The Unity Software Interface
    • The Default Interface
    • The Windows (Tabs)
      • Hierarchy Window
      • Scene Window
      • Project Window
      • Inspector Window
      • Game Window
      • Console Window
    • Other Layouts
      • Create a Custom Layout
  • Create
    • Creating Game Objects
      • 3D Primitives
      • Creating Game Objects in the Editor
      • Spawning Objects
      • Unhiding/Hiding Objects During Gameplay
      • Parenting
    • Creating Assets
    • Creating Components and Scripts
      • Adding Components in the Inspector
      • Creating Custom Components and Scripts
    • Creating Prefabs
  • Select and Update
    • General Selection
    • Search and Focus
    • Updating Game Objects
      • Updating Game Objects in the Editor
      • Updating Prefabs
    • Updating Assets
    • Updating Components
      • Update Components in the Inspector
      • Accessing Components Through Scripts
  • Delete
    • Deleting Game Objects
      • Deleting and Disabling Objects in the Editor
      • Using the Destroy() Function
    • Deleting Components and Scripts
      • Disabling and Removing Components in the Editor
      • Disabling and Removing Components During Gameplay
  • Translate, Rotate, and Scale
    • Intro to Transforms
    • Handy Transform Shortcuts
    • Translate
      • Positioning Game Objects in the Editor
      • Updating Position Through Script Code
      • Using the Transform.Translate() Function
    • Rotate
      • Rotating Game Objects in the Editor
      • Updating Rotation Through Script Code
      • Using the Transform.Rotate() Function
    • Scale
      • Resizing/Scaling Objects in the Editor
      • Updating Scale Through Script Code
    • Controlling Speed
    • Common Issues with Transforms
  • Materials
    • Material Basics
      • Creating and Applying Materials
      • Accessing Materials Through Code
  • Physics
    • Physics Basics
    • Colliders and Triggers
      • Collider Component Overview
      • Accessing Colliders Through Scripts
      • Common Issues: Colliders and Triggers
    • Rigidbody Component
      • Rigidbody Component Overview
      • Accessing the Rigidbody Component Through Scripts
      • Common Issues: Rigidbody Components
    • Common Issues: Physics and Velocity
  • Interaction
    • Interaction Basics
    • Keyboard Controls
    • Mouse Controls
  • Coding Basics
    • Intro to Scripts
    • Variables
    • Conditionals (If / Then / Else)
    • Arrays
    • Loops
    • Functions
Powered by GitBook
On this page
  • Prefab Overview
  • Creating a Prefab

Was this helpful?

  1. Create

Creating Prefabs

PreviousCreating Custom Components and ScriptsNextGeneral Selection

Last updated 4 years ago

Was this helpful?

Prefab Overview

Prefabs are sets of game objects with elements and settings you would like to use multiple times or have the ability to change one set to affect all instances of that set. Think projectiles, enemy NPCs, types of structures, etc.

When you add a 3D model to your Assets folder, it becomes a prefab.

Creating a Prefab

For an example, I made a weird character out of four different spheres with four different positions, sizes, and materials. It would take forever if I wanted to create this multiple times. Even if I duplicated the parent object, updating each could be a nightmare.

To make a prefab, click and drag the parent object in the Hierarchy into the Project window.

This creates a prefab asset that can be used multiple times, updated easily, spawned during gameplay, etc.

Prefabs are shown with a blue box icon and the game objects within the prefab are blue, meaning to update them, they need to be updated within the prefab.

Updating Prefabs
Set of object in the Scene View
Hierarchy Tab view
Project Tab view
Inspector Tab view
Hierarchy Tab view