What better Parent when I don't want an part to appear in the workspace?

I need to keep Parts active in my game, but they shouldn’t appear in the workspace.
Normally I have put the Parent=nil for these parts.
But in this case, I can’t find them anymore, using FindFirstChild.
What would be the most recommended place/folder to keep parts not appearing in the workspace?

parenting them to nil will erase them from the game, you should put them in the lighting replicated storage (both local and global can access) as my recommendation

1 Like

You can put them inside ReplicatedStorage

This way it will replicate to all players, and I don’t want it.

whats the exact situation on why you want the parents in a locked area while not replicating to players

you can change the transparency to 1 and set cancollide to false. That way it’s still in workspace and can’t be seen by players. You can also still get it with FindFirstChild still

part.CanCollide = false
part.Transparency = 1

Use a table to keep track of them.

local parts = {}

...

part.Parent = nil
table.insert(parts, part)

Alternatively, you can make a Folder not parented to anything:

local partFolder = Instance.new("Folder")

...

part.Parent = partFolder
1 Like

Only issue with this is it could lead to memory leaks, Luau tables always use strong references regardless of if the table has a metatable with its __mode metamethod defined. table.remove() should be used to appropriately remove destroyed BasePart instances from the table.

1 Like