Destroying any part causes a major client lag spike

Creating and destroying parts causes insane lag spikes and i have no idea why. I noticed this problem randomly yesterday and it never existed before that point so idk.

This video shows this issue, all im doing is creating a part and destroying it with game.Debris in a slow loop.

Things ive tried to combat this issue is turning off physics before destroying the part, setting its parent to nil instead and destroying it later but nothing seems to prevent it. This doesnt just happen in studio it also happens in the player, it happens with different users it also happenes when testing on my iphone 13.

This happens when destroying the part on the server and the client btw.


Here is the detailed graph for people smarter than me ^.

while true do
	if script.Parent:FindFirstChild("partNow") then
		local part = Instance.new("Part")
		part.Anchored = true
		part.Parent = workspace
		part.CFrame = script.Parent.HumanoidRootPart.CFrame * CFrame.new(0,3,6)
		game.Debris:AddItem(part, 3)
	end
	wait(1)
end

The loop i used in the video ^, yes the loop uses FFC but even a part that already exists being destroyed causes a lag spike.

Any help towards the right direction in fixing this is immense help thx for reading.

I mentioned this in a different thread yesterday. If you use skinnedmeshes, they need to be held within models.

Could also be humanoids in workspace that aren’t parented to models.

To test this, click file, and download a copy of the game. Open the copy, and click view and enable the command bar (it is one of the options but sorta hard to find- you’ll have to look through the icons)

Once you do this, paste the code I posted on the other thread into the command bar and run it, then try it again.

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.