- Home /
The question is answered, right answer was accepted
When should I use prefabs?
I'm wondering if I should create a prefab of, for example, my player object, since there will only ever be one of it. Is there any benefit or setback to doing so? I see why making a prefab for wall objects, enemies and the like since instancing them makes sense, but what about something lone and unique?
Answer by Absinthe23 · Feb 03, 2018 at 04:35 PM
There is no drawback to creating a prefab, as long as you're aware that any changes to a prefab edited in the scene will be permanent and affect all instances of it if you click the apply button.
Sooner or later you're likely to want to add new scenes to your project, in which case prefabs are the way to go. You don't want to have to re-create your player object every time you make a new scene, instead create a prefab for the player. The same is true for multiple projects.
Answer by Veith · Feb 03, 2018 at 04:40 PM
If you want to instance an object via code it makes sence to use prefabs.
In some cases it can be helpful to have a prefab of an object even if it only excists once in your project. For example if you want to tinker around with the settings but still have a working version on hand.
If you plan on exporting a package for use in a different Project.
But in general, if you don't ever use a prefab why create it at all?
Follow this Question
Related Questions
noobHell, prefab arrays, GameObjects, Random Spawning 1 Answer
2D Tilemap Gameobject Brush Script for Editor 0 Answers
Accessing Vuforia ARCamera.prefab position from a script 0 Answers
Can you assign a simple variable directly in Inspector without writing a script? 3 Answers
newbie: how to setup an input? 2 Answers