Copy+Paste multiple components in BULK in editor (inspector)

https://feedback.unity3d.com/suggestions/should-be-able-to-copy-plus-paste-components I made this, but I started to wonder, there has to be a way to do this (The $5 module on asset store hasn’t worked since 4x, people report).

Anyone have any ideas on how to do this? I’d pay $5 for working code if you throw it on the asset store.

EDIT: Multiple component**s** in BULK, rather, changed the title.
Because there’s a lot of fields serialized, it’s not ideal to do this programatically:,


Copy…
Copy Bulk >> Clear
Copy Bulk >> Add
Paste
Paste Bulk

Something like this

What do you mean? You can right click on a component and pick copy. Then right click and pick paste component or paste component values. You need to right click a components name area in the inspector.

1 Like

Right click on source gameobject, select copy. Select other game object, right click, select paste as new.

Edit: Karl beat me to it. :wink:

2 Likes

component__s__ :slight_smile: Sorry I was unclear – a bulk copy, is the best way to explain this – it seems that you can only copy 1 component at a time. Let’s say I have 10 scripts I want to copy to 10+ prefabs. That’s 100 copy+paste instead of 10.

Because there’s a lot of fields serialized, it’s not ideal to do this programatically.



Copy…
Copy Bulk >> Clear
Copy Bulk >> Add
Paste
Paste Bulk

Something like this

3 Likes

Dupe the prefab with components and change the other parts. (like the mesh filter, children, etc). Otherwise, I would just write a quick script to do it, you can use: Unity - Scripting API: EditorUtility.CopySerialized for the serialized data.

Though if it is one time deal, it is probably faster just to do it by hand. You can select multiple prefabs and paste the component on all of them at once, so really if you if you have 10 components and you want to paste it on 10 prefabs, it is only 10 copy+paste; if you have 50 prefabs, its still only 10 actions.

1 Like

Hi, @MrLucid72 ,

I’m the guy who throws Component Clipboard to the asset store.
Maybe you could take a look.

Excuse me for not really understanding what the “BULK” means.
I say, what’s the real usage you want, the operations?

My asset can help you to copy many components and paste easily.
But it might be still pain if you copy hundreds manually… LOL

What he wants is to copy and paste multiple components from one object to another, not only their values, which is what your awesome plugin does. :wink:

Unity only allows for one component to be copied at a time which is an incredible royal pain. I know there are workarounds like those zombiegorilla has suggested, but to me is an astonishing thing the Unity team has not included this as a built in feature.

There was a plugin called Component Copier in the past that did this, but it stopped working in 4.x. I’m pretty sure that if you could make a working plugin for this, or include it in your already great Component Clipboard… well, people around the World would absolutely love you. Me included. :smiley:

That 1$ plugin helped me with this issue. Unity Asset Store - The Best Assets for Game Making

3 Likes

Nice… I have been looking for this as well. I had begun making my own solution to this problem, but wanted to make it possible to just select components in the inspector, but this way works great, and you can even select which properties to copy.

There is no paste as components option in 2017.3.1

Awesomness, cant believe its not in unity… so useful.

All plugins return 404. Are there any other options?

2 Likes

Those 404 provide links to new pages

https://assetstore.unity.com/packages/tools/utilities/smartcopier-51298

1 Like

https://gist.github.com/aeroson/2f1b7abc1727c5608519 This script copy/paste all component, but it’s free

1 Like

I would suggest using an upgraded version of this script:
https://gist.github.com/frekons/2d002e560e8251e01841e2d83e8bf364

It has some additional null checks and looks robust

5 Likes

I’ve copied the script to the assets folder, but can’t find how to activate it in Unity :frowning:

Oh, found it, it’s under the GameObject top menu :slight_smile:

This version is better, the old one with cause build error because it use unity editor function but without check the run time build, run time don’t have editor function.

There’s no context menu when you right click the empty space on a game object inspector, and the Edit menu has nothing helpful to offer. It would be really nice if someone could explain how/where this capacity to “paste” comes from when the editor UI provides no such thing and the people at Unity don’t feel the need to support their own product.

8827657--1201879--upload_2023-2-22_16-40-40.png

The triple-dot button is your friend.