Is it possible to swap an object for another; i.e use cubes as stand-in placeholders while setting up the game, then simply swap them for another more detailed mesh, with the new object obviously inheriting the scripts and other attributes of the original? If it’s there I seem to have missed it…
var myMesh : Mesh;
function Start()
{
// Do starting stuff
gameObject.GetComponent(MeshFilter).mesh = myMesh;
Destroy(gameObject.GetComponent(BoxCollider));
gameObject.AddComponent(MeshCollider);
}
The above should work. It assumes you have a box collider on the cube and you want a mesh collider after changing the mesh.