Quick duplicating of lots of objects.

Hi! I'm still trying to make a good looking rope. Yesterday I asked a question about rope making( http://answers.unity3d.com/questions/15581/how-do-you-make-ropes And now trying to connect a lot cylinders with hinge joints. And it seems it works, but ther are still some problems.

If there are not that many objects - everything is ok, but if I want, for example, 100 objects to be connected with joints(200 objects, 500, etc). I'll have to manually change the names of the duplicated objects, then manually assign connected body property of each joint. It takes a huge amount of time, almost forever. So if there is a way to do it more quickly? What would you do if you had to make a rope consisting of 1000 cylinders and 999 hinge joints?

p.s. It is ok that the rope is going to have lots and lots of polygones.

Instantiate your rope sections at runtime as Prefabs. Basically code what you are doing manually.

eg. you might have a gameobject Rope which will have 1000 child game objects. Supply the rope segment to the Rope as a prefab.

In Awake/start in a script RopeScript on your Rope object instantiate all your rope objects creating the appropriate hinge joints as you go. To keep things simple you might want to just chain them together in a straight line and then perhaps let the physics calculation let the rope drop over a pully if you have one (this may or may not work well - depending on how crazy the physics gets). Or even just approximate the final shape/path of the rope before letting physics settle it into place.

ie. (psuedocode)

var ropeSeg : GameObject; //Set prefab here
var posOne : Vector3; // first segment position
var rot : Quaternion; // orientation of the segement

function Start()
    var tempSeg0 : GameObject = Instantiate(RopeSeg, posOne, rot);
    var tempSeg1 : GameObject;

    for(var i=0; i<numSegs; i++)
        var nextPos = ...//calc next instantiation position
        //update rot if needed
        tempSeg1 = Instantiate(RopeSeg, nextPos, rot);
        someCreateHingeJointFunction(tempSeg0, tempSeg1);//attach tempSeg1 to tempSeg0

        tempSeg0 = tempSeg1; //save reference to current segment