Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

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

Discussion in 'Editor & General Support' started by MrLucid72, Feb 8, 2016.

  1. MrLucid72

    MrLucid72

    Joined:
    Jan 12, 2016
    Posts:
    902
    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 components in BULK, rather, changed the title.
    Because there's a lot of fields serialized, it's not ideal to do this programatically:,
    <Component Menu>
    ...
    Copy...
    Copy Bulk >> Clear
    Copy Bulk >> Add
    Paste
    Paste Bulk
    ...

    Something like this
     
    Last edited: Feb 9, 2016
  2. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    7,850
    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.
     
    Joe-Censored likes this.
  3. zombiegorilla

    zombiegorilla

    Moderator

    Joined:
    May 8, 2012
    Posts:
    8,980
    Right click on source gameobject, select copy. Select other game object, right click, select paste as new.

    Edit: Karl beat me to it. ;)
     
    Joe-Censored and karl_jones like this.
  4. MrLucid72

    MrLucid72

    Joined:
    Jan 12, 2016
    Posts:
    902
    components :) 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.

    <Component Menu>
    ...
    Copy...
    Copy Bulk >> Clear
    Copy Bulk >> Add
    Paste
    Paste Bulk
    ...

    Something like this
     
  5. zombiegorilla

    zombiegorilla

    Moderator

    Joined:
    May 8, 2012
    Posts:
    8,980
    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: http://docs.unity3d.com/ScriptReference/EditorUtility.CopySerialized.html 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.
     
    MrLucid72 likes this.
  6. Wanzyee

    Wanzyee

    Joined:
    Jul 24, 2015
    Posts:
    135
    Hi, @dylanh7244,

    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
     
  7. Abelius

    Abelius

    Joined:
    Nov 11, 2016
    Posts:
    37
    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. ;-)

    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. :-D
     
  8. Gua

    Gua

    Joined:
    Oct 29, 2012
    Posts:
    455
    albertjames, twobob and kblood like this.
  9. kblood

    kblood

    Joined:
    Jun 20, 2012
    Posts:
    92
    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.
     
  10. diliupg

    diliupg

    Joined:
    Jan 23, 2018
    Posts:
    45
    There is no paste as components option in 2017.3.1
     
  11. albertjames

    albertjames

    Joined:
    Aug 11, 2018
    Posts:
    16
  12. datagreed

    datagreed

    Joined:
    Sep 17, 2018
    Posts:
    42
    All plugins return 404. Are there any other options?
     
    sj631 likes this.
  13. Gua

    Gua

    Joined:
    Oct 29, 2012
    Posts:
    455
    Vaupell likes this.
  14. dmi3iy

    dmi3iy

    Joined:
    Mar 30, 2013
    Posts:
    4
    MUGIK likes this.
  15. MUGIK

    MUGIK

    Joined:
    Jul 2, 2015
    Posts:
    453
    alexdove, mikeohc, fairtree and 2 others like this.
  16. TaroBall

    TaroBall

    Joined:
    Jul 24, 2021
    Posts:
    2
  17. TaroBall

    TaroBall

    Joined:
    Jul 24, 2021
    Posts:
    2
    Oh, found it, it's under the GameObject top menu :)
     
  18. victorkin11

    victorkin11

    Joined:
    Apr 20, 2013
    Posts:
    175
    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.
     
  19. MaxxVelocity

    MaxxVelocity

    Joined:
    Sep 29, 2019
    Posts:
    12
    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.
     
  20. chemicalcrux

    chemicalcrux

    Joined:
    Mar 16, 2017
    Posts:
    717
    upload_2023-2-22_16-40-40.png

    The triple-dot button is your friend.