Make parts too far away not spawn

Hello, I was wondering if there was a way to make parts that are too far away not spawn until you get within range. This would help reduce lag.

I’m not sure. For some odd reason, Streaming Enabled used to work for me, but as of right now, I know of no way to change the draw distance

You can make a script like this (not exactly, but just an example)

for i,v in pairs(game.Workspace:GetChildren()) do -- this can also be GetDescendants
	if (LocalPlayer.Character.HumanoidRootPart.Position - v.Position).magnitude > 500 then -- 500 would be the max magnitude
		v:Destroy()
	end
end