Part Spawning Limit?

I’m trying to test something to do with physics parts and lag, but for some reason, it won’t spawn more than 5-6 parts (the amount of parts don’t even seem to matter, it’s more based on the speed of the loop) before it starts to instantly delete any new parts being cloned in. I was basically making a part that would spit out small ball parts rapidly. I’ve never had this issue before until just now. Anyone know why this is happening and how I might be able to get around this?

It looks like this:

2 Likes

Are the balls falling into the void? if so then they’re being deleted by FallenPartsDestroyHeight property which can be found in the Workspace instance.

No, there’s a baseplate and they all have collision enabled. The original set of parts don’t get removed, only the newer ones for some unknown reason.

Do you have any other scripts or plugins that could be tampering with spawning the balls?

I’ve disabled all other scripts and I don’t think any of my plugins would do this, plus I’ve never had this issue before. Also, the spawner part I was using for the position is also being removed for no apparent reason.

Like it’s literally just this:

local ignore = workspace:WaitForChild('Ignore')
local spawner = ignore:WaitForChild('Spawner')
local ball = script:WaitForChild('Ball')

while true do
	local part = ball:Clone()
	part.Position = spawner.Position
	part.Parent = ignore
	part = nil
	task.wait()
end

Try removing part = nil, it could be possibly causing the game engine to remove it.

Setting a variable to nil only removes it from the reference memory so that it can be properly garbage collected when destroyed. But yes, I tried removing that anyway and it didn’t change a difference. I also tried changing where the ball was located and also tried this on the client.

Could you try this yourself and see if it happens to you? If it doesn’t, maybe it really is a plugin somehow.

Nvm, it was just that the spawner itself was unachored and had no collision, so the parts where spawning in the void instead. My bad.

2 Likes