How much parts is too much? Advice needed for Obby

If you’re having issues with Part limits, try implementing a rendering system.

In my opinion, this kind of system helps a lot in games that have to render a lot parts all at one time. With obbies, this should help even a tiny bit with performance.

If you want a pretty performant system, I’d try to make a system that “Caches” obbies in and out based on how close each Player is to that obby. I’d to this on the client and never on the server because each Player renders each obby differently at different intervals, etc.

By setting the CFrame of each obby to a large number (away from where the actual gameplay happens), you’re able to stop rendering of those parts and make sure players never see those obbies when they aren’t supposed to be rendered.

You could store a CFrame of each part in a table when the server first starts up, and when a Player gets close enough (you could make a chunk-based system or check the difference and give a constant radius):

local ObbyCFrames = {}; -- The table for our CFrames
local ObbiesFolder = workspace.Obbies -- Wherever your obbies are stored.

for _, Obby in pairs(ObbiesFolder:GetChildren()) do 
	if Obby and Obby.Parent then 
		ObbyCFrames[Obby] = Obby.PrimaryPart.CFrame; 
		
		-- ^^ I would create a 'Core' PrimaryPart for each obby (if it's a Model) that is Transparency 1, etc. 
		-- so that you can set each obby's CFrame off that one PrimaryPart. 
	end
end


-- UNRENDER (CACHE):
Obby:SetPrimaryPartCFrame(CFrame.new(0, -1000000000, 0)); -- Set it to something huge.

-- RENDER BACK :
Obby:SetPrimaryPartCFrame(ObbyCFrames[Obby]); -- Set back to the original CFrame.

Helpful articles:

3 Likes