Multiple Bones Lagging, Basic Instance Functions

I’m pointing out the big detail and information about the bug. Basically, my game has a Sea with 2026 bones across the surface. I have 9 of them placed in a grid. When running Instance.new(), even with the bones inactive. The sea is client sided, and the bones lag the user once you insert a part into workspace. Keep in mind the Sea is in workspace.

If the Sea is moved from workspace to ReplicatedStorage, and is ACTIVE it wont lag. This might be due to a streaming error, when rendering the bones and the part together on insertion. There is total of 18234 bones for the whole sea.

In conclusion, the client lags due to multiple bones. It doesn’t lag cause the bone exists. It lags because you insert a part with the Sea in workspace, even when it’s inactive (no scripts just in workspace). I HAVE NO OTHER SCRIPTS THAT ARE UNOPTIMIZED AND LAG.

I just parent the sea into workspace, 9 of them and they lag on part insertion. Anything instance, that is a part, a meshpart, a union. If it gets moved from ReplicatedStorage to workspace, Lighting to workspace, Player.Backpack to workspace. yeah that lags too

TLDR; Sea lags and has, 2026 bones each, 18234 in total. from Instance.new("Part") both in workspace
TLDR SHORTER; Multiple bones that are in workspace lag. Instance.new("Part")

In these following videos, I show part insertion with it inactive and in workspace, and inactive and in replicatedstorage.
I could’ve parented the seas, but it still would have the same problem.






my system information

This game just has the seas and you can run Instance.new(“Part”), and it’ll drop your frames

Sea Lag.rbxl (100.0 KB)

Expected behavior

When doing Instance.new(“Part”) it should not lag the user on the client side.

5 Likes

There has historically been an issue with bones outside of models. Because your bones are in a meshpart outside of a parent model, it treats the workspace as the parent model, so adding anything to workspace invalidates some internal data and triggers an update that is very expensive. You should put all of your sea meshparts into a model, I don’t anticipate this being fixed for a while.

2 Likes

Yoo actually thanks for that, that actually helped me so much!

1 Like

Happy to help, but I wouldn’t mark solution. This is still an issue and it would be nice if this wasn’t such an invisible gotcha.

2 Likes

There is a fix planned for this according to Heavy lag when resizing parts for everyone in team create - #12 by Sir_Bedevere

1 Like

Thanks @WheretIB. Here is the script from that link, please let us know if it doesn’t resolve your issue:

local function addSkinMeshModels(parent)
	children = parent:GetChildren()
	for _, child in children do
		if child:isA("MeshPart") then
			if child.HasSkinnedMesh then
				print(child.Name)
				model = Instance.new("Model")
				model.Name = child.Name
				model.Parent = parent
				child.Parent = model
				continue
			end
		end
		if child:isA("Model") then
			continue
		end
		addSkinMeshModels(child)
	end
end

addSkinMeshModels(game:GetService("Workspace"))