# How to pre-configure a prefab in the editor for multiple similar buttons before instantiating them

Let me explain my problem with my concrete example. I have a button prefab. A button prefab has a lot of configurations: background color, background shape, background image, text, text color, button type, text size, background size, etc.

I have a few places where I use the button prefab. In some places I can just manually put the prefab into the scene in-editor and preconfigure a button. But there are other places where I need to instantiate a batch of buttons with almost the same configuration.

Sure, I could setup each of these buttons in code during the instantiation. But that seems cumbersome. So, what I did is I added a button prefab to scene. Then configured it as I wish. Then hid it in the scene. Then created a script with a reference to a GameObject and now instead of a prefab from a file explorer I put the hidden configured button in that reference. So, now during an instantiation I only need to change the enablement of the instantiated button instead of configuring it from code.

I am really eager to know if there is a better way to do what I am doing.

• Why not create a second button prefab for that script, perhaps as a prefab variant of the basic button? May 22 at 9:43
• @Philipp, because if my general button prefab will change in future I would like the changes to propagate to all buttons. I do not know if it will be possible to do in case I will use a separate prefab for this specific group of buttons. May 23 at 7:37
• You can do that with Prefab variants.. May 23 at 10:03

You can do that with prefab variants. A prefab variant is a prefab which inherits most of its properties from another prefab.