Yes, that is what will happen with this new behavior
I am a bit confused, in the example of the old behavior, you state that after the local script runs, then the server removes partA, there is a lingering reference. However, I thought once a script ended, any references were removed?
Astute observation: The example is just a stand-in, assume that the print statement is actually some arbitrary real work which keeps the script doing stuff and actively holding onto the reference.
oh ok, I … sort of … assumed that was the case, but just wanted to make sure.
Thanks for the clarification.
Is the current behavior maybe being exploited with the trick parenting a character to Lighting, and modifying or switching it somehow?
In your folder example, what happens if the client retains a reference to that folder? Is it destroyed by the client as soon as it’s parented to nil by the server or is it just parented to nil on the client as well?
If the latter, wouldn’t that be a memory issue since instances aren’t gced unless destroyed?
The new behavior does not call Destroy() - it just parents to nil on the Client for symmetric behavior, and like you pointed out, this could result in a memory leak.
Though doing something like Destroy() on the Client-side might be an elegant solution for some use cases, there are also definitely cases that it breaks. What if the Client intentionally has a LocalScript holding a reference to Folder, because they need it for a script? What if the Server decides to bring Folder back into the DM later in the experience, but the Client can’t because Folder’s parent has been locked via Destroy()?
We designed this change under the assumption that if a Dev does write a LocalScript to have a lingering reference to an Instance that was removed on Server, that it must be intentional.
But maybe we are thinking that something is the audio that Roblox uploaded
I’m unsure if this issue is related to this update, but as of recently parenting guis from replicated storage into player gui is automatically destroying the guii in studio, but works in-game.
That might be related - do you have a simple repro you could share?
GuiBug.rbxl (34.6 KB)
This documentation suggests that PlayerGui gets reset whenever the Character gets loaded. If I change the LocalScript in the repro to do this:
local PlayerGui = game:GetService("Players").LocalPlayer.PlayerGui local Gui = game:GetService("ReplicatedStorage").ScreenGui local Player = game:GetService('Players').LocalPlayer Player.CharacterAdded:Wait() Gui.Parent = PlayerGui
Then the reparenting works, at least on my end.
I’m not totally sure why the repro without the wait works in-game today though…
Isn’t the reset behavior based on the ResetOnSpawn property of the screen gui? Also, it still works if you disable CharacaterAutoLoads and add the wait, so I don’t think it is based on the character loading.
Here is a repro with character loading disabled and still works with the wait added.
GuiBug.rbxl (35.1 KB)
Hmm you’re right. I’ll investigate and update this thread, thanks!
Thank you for the report! It looks like this change has an adverse impact on adding to PlayerGui this way, so I’ll be rolling the changes back for now. I will update this thread again when this is fixed.
Thanks for your patience!
Any update or ETA on when this will be rolled back?
This change has also broken my game and is causing disruption to players while we wait for the changes to be reverted.
It has already been rolled back as of when I made this comment: De-Sync Bugs with Instance Replication Fix - #25 by asdfiji123
It was also only ever released on Studio, not on the Server or Client, so it should never have impacted your player base.
If your experience is experiencing bugs, I think it’s probably a different cause :/. If you think it’s an engine issue, please make a separate bug report so we can get the right eyes on it!
This change is now being re-enabled on Studio! We’ve implemented a fix for the negative interaction with PlayerGui at the beginning of the game, so please let us know if this issue somehow persists, or you see any other problems.
We have now rolled out this change globally. If you find that this change causes bugs in your game, please let me know in this thread!
Edit: This has been reverted due to errors when the Character is parent to nil and then back to Workspace in Streaming Enabled games.