instantiate a replacement

I am having trouble thinking through the best way to accomplish this…

A player crashes–hinge joints break, etc.
I want to rebuild the original player control prefab–but keep all the references intact, i.e. camera, particle effects.

Destroying the old, instantiating a new means I lose all the references.
I could group everything that has a dependency together–but that seems like a waste.

Is it better to just reattach everything in code?

Can’t you just disable / hide the ‘destroyed’ limb? then to re-enable it, you simply show / enable it? Don’t call Destroy(object).

I think you can turn just about everything off on an object programatically, including how it reacts to collisions, how it is seen, what it does, everything.

think more like a player riding in a vehicle, the player gets knocked out of the vehicle–

wait 5-10 seconds

respawn the player in vehicle

Ah thats easy then, simply have an object that stores last position of player parent object, then on the timer, reset player to last good player position. You don’t have to destoy anything that way.

Store the transforms someplace this way you can just reset the parent to those transforms.

how do I rebuild the hinge joint connecting the player to the vehicle then?

There are a few ways to do this, and as far as I can tell the easiest way is clone. You create 2 player objects one is the visible one, one is not, the visible one is the one hinged to the car, the invisible one is the one you will throw out of the car. When you wreck or whatever, you ‘blip’ the two, making the invisible one visible, and the visible one invisible and toss the newly visible one.

Other than that, you would have to reset the one you just threw out the vehicle and reparent it and rejoint it. I haven’t worked with joints yet, so don’t know how difficult that might be, but from my current limited experience, parenting objects programaticly isn’t hard at all.

A quick look at the docs:
http://unity3d.com/Documentation/ScriptReference/Joint-connectedBody.html?from=HingeJoint

This allows you to do it programatically.