Iterating and updating transparency for a massive amount of parts

  1. What do you want to achieve?
    For my build system, I would like to hide floors that are not applicable without lag.

  2. What is the issue? Include screenshots / videos if possible!
    The system works correctly, but you get substantial lag spikes in the micro profiler and noticeable slowness on the client. Probably due to all the parts.

  3. What solutions have you tried so far?
    I’ve tried using Collection Service to only update parts as they need to change rather than using :GetDescendants()

Below is a sample of what I’m using when you first enter build mode. It also splits it by floor number by getting the first folder ancestor.

for i,v in ipairs(game.Workspace.Builds:FindFirstChild(self.userId):GetDescendants()) do
			if v:IsA("BasePart") and (v.Name == "RoofObject" or v.Name == "Roof") then

				local folder = v:FindFirstAncestorOfClass("Folder")
				table.insert(self.currentObjects[tonumber(folder.Name)],v)
				v.LocalTransparencyModifier = 0.9
			elseif v:IsA("BasePart") then
				local folder = v:FindFirstAncestorOfClass("Folder")
				table.insert(self.currentObjects[tonumber(folder.Name)],v)

			end
		end

Here is the video: