gameObject.AddComponent(presetComponent) ?? I would like to add a component thats already created.

Lets say we have a Component called “Traits” that has some perimeters.

public class Traits : Monobehaviour {
    public string traitName = "someone";
    public float height = 6.2;
    public float weight = 236;
    public Color hairColor =;

Now what I would like to do is create a few of these and then add them to a game object later. To create them lets say I do something like this.

public List<Traits> traitsList = new List<Traits>();
for(int i = 0; i < 10; i ++){
     Traits newTrait = new Traits();
     newTrait.traitName = "Bob";
     newTrait.hairColor =;
     newTrait.weight = 400;
     newTrait.height = 5.2;

Now I would like to add them to a game object but I am doing it wrong somewhere.


Not a thing, and neither is
someNewGameObject.getComponent() = savedTraits*;*
Em I just approaching this wrong? I would like not to do something like.
Traits newTrait = gameObject.AddComponent();
// And then have to assign all the elements on its own, that would suck if the properties are a long list.
newTrait.traitName = savedTraits*.traitName;*
newTrait.weight = savedTraits*.weight;*
newTrait.height = savedTraits*.height;*
// and so on.
I may just have to rethink this hole spiel but it seams like there should be a way.
Thanks for checking it out.

You can follow solution in this thread. here