|
| 05 Apr 2013 07:05 AM |
I used blockmeshes to remove bevels from my vehicles to make them look nicer.
Would it be of any benfit to remove all the blockmeshes now? Ie. would it make my game run faster? |
|
|
| Report Abuse |
|
|
pauljkl
|
  |
| Joined: 23 Oct 2008 |
| Total Posts: 9364 |
|
|
| 05 Apr 2013 07:55 AM |
Parts with a blockMesh will stop parts from casting shadows which may speed up your game but the memory usage is larger with them in.
If you want to remove them, use this:
function removeMesh(place) for _,child in pairs(place:GetChildren()) do if child.ClassName == "BlockMesh" then child:Remove -- Used remove so if you're testing, you can revert elseif #child:GetChildren() > 0 then removeMesh(child) end end end removeMesh(Workspace) |
|
|
| Report Abuse |
|
|
|
| 05 Apr 2013 08:00 AM |
Couldn't you just try it and find out. Then come back and post what you found.
Removing meshes would decrease lag , if there was any to begin with. But I don't think it would be any large reduction of lag. |
|
|
| Report Abuse |
|
|
|
| 08 Apr 2013 03:25 PM |
| Scac, I have a few hundred (maybe thousand) meshes in my game. I wanted to ask if there was any point wasting my time to remove them all. |
|
|
| Report Abuse |
|
|
pauljkl
|
  |
| Joined: 23 Oct 2008 |
| Total Posts: 9364 |
|
|
| 08 Apr 2013 03:56 PM |
| Mario, the script I game will run in command bar and will remove all meshes in Workspace, you could change the calling line at the bottom to other services if you want to remove Meshes from those too |
|
|
| Report Abuse |
|
|
|
| 16 Apr 2013 03:23 PM |
| I cannot see where to tell it to search for blockmeshes plus I can't see it being able to go through models to parts to find the meshes. |
|
|
| Report Abuse |
|
|
pauljkl
|
  |
| Joined: 23 Oct 2008 |
| Total Posts: 9364 |
|
|
| 16 Apr 2013 08:34 PM |
Ahh, ill put comments in since you don't understand recursion
function removeMesh(place) -- Function with name and a place to search in for _,child in pairs(place:GetChildren()) do -- Check all children of the place being searched if child.ClassName == "BlockMesh" then -- If the child is a BlockMesh child:Remove -- Remove the BlockMesh elseif #child:GetChildren() > 0 then -- Otherwise if the child has children itself removeMesh(child) -- Run this function but inside the object with more than 0 children end end end removeMesh(Workspace) -- Start the branching down from Workspace by calling the function |
|
|
| Report Abuse |
|
|