How to set up a paper-doll character?

How would I go about setting up a character I want to use a paper-doll system to generate their body?

For example, I make 10 sets of arms, 10 torsos, 10 heads, and 10 sets of legs with hips. (I’m fully aware of how to model and animate each of these, that’s not my question). Then I want my character to let’s say randomly have one of each category to build its body. (Again, I’m aware of how I would code the probability system, that’s not my question).

What I want to know is, do I have to put all 40 models on the character and have all but the 4 it’s using be deactivated/deleted or something? Or, is there a way to tell the character what ones to spawn as soon as the character spawns?

I don’t know if anyone else has made a similar system or what the standard approach to this would be.

*EDIT: I’m figuring that some system of Instantiating the parts at a specific place and then making it a child object somehow is how to do this. Now that I’m closer to wrapping my head around how to do this, I guess this is turning into more of a code question.

You can do either, it is up to you.

Well I tried the method of having the object instantiate all the parts and then try to make them children of itself and it didn’t work. The unity manual isn’t very helpful on this. It gives an example for how to make a camera and make it a child of the current object, but the syntax for a non-camera object is apparently different and I can’t seem to find an example.

Here’s what I basically tried in JS
Creates, but doesn’t link the head;

var head1PD : GameObject;

function Start () {
ChangeHead();
}

function ChangeHead () {
var head1Inst = Instantiate(head1PD,transform.position,transform.rotation); 
head1Inst.parent = transform; //<--This does nothing!
}

Okay I needed the parent line to be:

head1Inst.transform.parent = transform;

So my quest to make the paper doll system continues… I wonder what challenges will await me?

Instantiating and parenting seems like the most flexible option, but from experience I can tell you that in
the end it creates a lot of problems, especially when you need to import a lot of content (which is usual in these scenarios).

You have to be careful with coordinates, axis, doing the parenting at the correct time (t-pose most likely).

I think you should at least do all the parenting and setup in a 3d editor (max, maya etc) and then just switch
things on and off. This way you will have one file and you don’t have to worry about these problems.

I don’t know if they will affect performance even though they aren’t getting rendered (they shouldn’t). If they
do there are some options to address this.