From the course: Unity 2023 Essential Training

Unlock the full course today

Join today to access over 23,200 courses taught by industry experts.

What are Prefabs?

What are Prefabs?

- [Instructor] If you've read or watched anything related to Unity, you may have heard of this term prefabs. A prefab, in its simplest form, is a template from which you can create multiple instances of the same object, keeping all its properties. And when you need to make a change to an instance, you simply update the prefab, and all its children will be updated. Typically, prefabs are used for props or NPCs, which is short for non-player character. So for example, if you want to create a forest with dozens of similar trees, prefabs are perfect for this. You can create a player prefab if you'd like to, but since a game typically only has a single character instance, this might not be useful. You can also nest prefabs and create variations within these nested branches of your hierarchy. For example, if you wanted to create two different sets of trees with dozens of children each but one set with green leaves and the…

Contents