Making a simple script to make parts in a curtain parent a amount of studs away not render/show

Hello, I am wondering if it’s possible to make parts in a specific parent not render.

Here is a diagram of what I mean:


The black text is not in the parent allowing it to render like normal.
The blue/purple text is in that parent allowing it to render when close to the player in a radius.

Is this possible?
If so, could I get some help on how it is done.

Thank you, Zonix.

The StreamingEnabled property in workspace might work for you

Won’t this do anything that is in workspace and not in a specific thing in workspace?

Oh for specific things, then uh
I’m not too sure since StreamingEnabled is the best option but

local storeTable = {}
game:GetService("RunService").RenderStepped:Connect(function() 
  for i, v in pairs(workspace:GetChildren()) do
    if player:DistanceFromCharacter(v.Position) > 60 and v.Parent = workspace then
     storeTable[#storeTable] = v
     v.Parent = nil
   end
  end
  
  for i, v in pairs(storeTable) do
    if player:DistanceFromCharacter(v.Position) < 60 and v.Parent = nil then
     storeTable[#storeTable] = v
     v.Parent = nil
   end
  end
end)

Maybe something like this
Maybe a loop but I’m not too sure

Edit: Also identify if you want that part to be rendered as well in some way

YES, Thanks man!
I really do appreciate it!
I had to tweak the code todo what I wanted but it’s been done!
Once again, thank you!

1 Like