Is there a similar function than transform.Find that searches the whole hierarchy? not just the direct children of the object?
static function CopyTransformsRecurse (src : Transform, dst : Transform)
{
dst.position = src.position;
dst.rotation = src.rotation;
for (var child : Transform in dst)
{
// Match the transform with the same name
var curSrc = src.Find(child.name);
if (curSrc)
CopyTransformsRecurse(curSrc, child);
}
}
It comes from 3D Platform Game tutorial. Remove and fix unneeded parts.