I’m a little confused.
In my game, I save the references of the created object instances in a table.
In some cases, I destroy the object.
Then I have to scan this table and remove the object that was destroyed.
local tab = {}
local obj1 = Instance.new("Part", workspace)
local obj2 = Instance.new("Part", workspace)
tab[obj1] = true
tab[obj2] = true
obj1:Destroy()
print(tab)
generate a guid for each part and use collectionservice to add the guid to it as a tag and use getinstanceremovedsignal to remove obj from table when it is destroyed