- Home /
Duplicate Question
copy all components from one character to another
I have a character that has many different components on different bones. I revised the model and want to bring in a new one and was wondering if there's some easy way to copy all the components from the old character to the new one. I can't swap the meshes because the mesh was output from a different program the second time and seems to have a different mesh structure, but the bone hierarchy is the same.
Use this
Component[] Components = Selection.activeGameObject.GetComponents("Component") as Component[] ;
And
UnityEditorInternal.ComponentUtility.CopyComponent(copiedComponent);
UnityEditorInternal.ComponentUtility.PasteComponentAsNew(targetGameObject);
A simple little editor extension to copy and paste all components: https://gist.github.com/aeroson/2f1b7abc1727c5608519#file-componentscopier-cs
The one in asset store is much more advanced, can copy hiearchies and much more.
Answer by DaveA · Sep 22, 2013 at 12:04 AM
Get the Component Copier from the Asset Store