`Destroy()` does not replicate fully on client

Reproduction Steps
Hit play in the place I attached. It destroys a part in workspace from the server. The client listens using a ChildRemoved event and is able to reparent it to workspace.

--LocalScript
workspace.ChildRemoved:Connect(function(Descendant)
    print(Descendant, "Removed!")
    wait(1)
    Descendant.Parent = workspace
    print(Descendant,"Parent set to", Descendant.Parent)
end)
--ServerScript
workspace.Part:Destroy()
Output:
> Part Removed!
> Part Parent set to Workspace

Uploading: destroy_not_replicated.rbxl…

Expected Behavior
Parent should be locked on client and Destroy() should be called disconnecting client sided connections.

Actual Behavior
Instances destroyed on the server can be reparented on the client. Is this supposed to happen? This would mean parts made on the server that have connections on the client would never be GC’ed.

Workaround
Manually calling Destroy() on the client

Issue Area: Engine
Issue Type: Performance
Impact: Moderate
Frequency: Constantly
Date First Experienced: 2021-12-23 13:12:00 (-05:00)

1 Like
3 Likes

FYI, this is not entirely accurate. Destroy and locking the parent is not a strict prerequisite for GC.

If the client has no reference to the part, the part would be normally garbage collected, even if it hasn’t had its parent locked.

PS: you sent out your post too early – the upload didn’t work properly.

2 Likes

This issue has already been reported. Please follow this topic for updates on this issue: Instance:Destroy() Only Replicates Parent = nil Change

3 Likes