Create Multiple Prefabs at Once

I want to share with you how to create multiple prefabs from selected GameObjects at once. When I work with Unity 5 I always need to import a lot of meshes into the scene, setup them and create a bunch of prefabs. But sadly Unity let’s create only 1 Prefab at a time. And this script helps me to select all my GameObjects in the Hierarchy(Scene) and create a lot of prefabs at once, just with one button click. It saves me so much time!

Open Unity 5 project and inside Project tab open folder called Assets and inside that folder create another folder called Editor. Download CreateNewPrefab.cs script file and put it inside Editor folder:

Now at the top,  you should see new option appeared called Prefab

To test this out, create 2 or more GameObjects inside the Hierarchy(Scene), select all those objects and go to Prefab > Create New Prefab

That’s it, open Assets folder, you should see all Prefabs you just have created (for this example I’ve created 2 separate Prefabs, Cube and Sphere):

Now you can delete those GameObjects from the Hierarchy(Scene) and use Prefabs inside any Scene you want.

Script (CreateNewPrefab.cs) was slightly edited by me. You can find original script source HERE.

  • Follow me on Twitter to see what I’m working on. I try to post here something every day 🙂
  • Follow me on my Instagram 
  • Also, check out my Facebook

Pin It on Pinterest