Assume you have checked that MeshToAttach has a value > 0?
Also, make sure you compare child to otherchildren to ensure that you're not parenting a child to itself .. I think will cause issues.
Also, make sure you compare child to otherchildren to ensure that you're not parenting a child to itself .. I think will cause issues.
Function AttachMesh(MeshToAttach,Mesh) For Children = 1 To CountChildren(MeshToAttach) Child = GetChild(MeshToAttach,Children) For OtherChildren = 1 To CountChildren(Mesh) OtherChild = GetChild(Mesh,OtherChildren) If Child <> OtherChild If EntityName(Child) = EntityName(OtherChild) EntityParent(Child,OtherChild) Exit EndIf EndIf Next Next End Function