So I have a 10k part model generated through an OBJ importer. The children of said model have mesh that makes each part uber thin. This creates an illusion of the player floating over the actual part. (Hard to put into words, just witness it for yourself here: http://www.roblox.com/Overrun-place?id=155627099)
Anyways, I discovered that deleting the mesh returns the model to its correct size and eliminates the crappy illusion. Now, since there are 10k parts: I DON'T WANNA OPEN UP EACH ONE IN THE EXPLORER AND DELETE THE MESH.
It would take me OVER 9000 years to do.
So how would I get the children of the children of a model and delete each child?
Here's the hierarchy:
Model > 10k Parts Each individual part > Mesh
How do I delete that mesh?
Use a for loop and delete each mesh:
for _, v in pairs(game.Workspace.Model:getChildren()) do -- This gets all of the children and places them in a table, and then loops through each child wait() -- Just a little safeguard to avoid crashing if v.ClassName == "Part" and v:findFirstChild("Mesh") then -- Check if object is a part and has a mesh v.Mesh:Destroy() -- Destroy the mesh end -- End if statement end -- End loop
z = game.Model:GetChildren() for i = 1,#z do z[i]:FindFirstChild("Mesh"):Destroy() wait() end
That should destroy the mesh's
Plus 1 if this helped , check mark if this answered your query :)