Welcome to the Treehouse Community
Looking to learn something new?
Ranvir Sahota9,844 Points
Why use a prefab when the object is only used once?
A prefab is used for when duplicates of the object will be made. But some prefabs will not have duplicates so why make them into prefabs? Examples: bird, player, and Environment are all used once but yet they are all prefabs.
For teaching purposes, it is kept easy but I would still say that saving these objects in prefabs is a good practice to do. For example, if you want to load a new scene with a new level into your game you can easily reuse your player or enemy prefab. Additionally, you keep your game scalable. You could easily add a second enemy to change the difficulty level of the game for example. And you can instantiate prefabs at runtime very easily. You could spawn the enemy bird some seconds later while the frog is already collecting flies.
And another advantage is that the prefab doesn’t change if you misclick. While changing some things in your scene you could easily end up changing your frog without noticing it. Afterwards you would have to search for the mistake. If you have a prefab you could just delete the prefab from your scene and add it again.