I love this change a lot! Also could you guys add a property that indicates if is destroyed or not?
Instance.Destroyed --> Boolean (Readonly)
Instance:Destroy() --> Sets the property Instance.Destroyed to true.
I love this change a lot! Also could you guys add a property that indicates if is destroyed or not?
Instance.Destroyed --> Boolean (Readonly)
Instance:Destroy() --> Sets the property Instance.Destroyed to true.
The only detail I am missing that could be useful is a IsDestroyed() function to check if an Instance has been destroyed or not.
I agree, but this would be a good temporary solution since it wonât interact with existing projects.
The documentation for Workspace.FallenPartsDestroyHeight
may need to be updated then, as it suggests that parts are removed with Instance:Destroy()
when they hit the height.
Regardless, if there are still possible ways that parts can be âdestroyedâ without being :Destroy()
'd, it somewhat negates this whole feature change as we will still need to put in the extra steps to account for such cases and cleanup accordingly. Is there any way the behavior could be changed so that .Destroying
does fire when the authoritative peer determines it did indeed fall out of the world?
I didnât actually see anything in the post saying whether this was live in games or only available in studio testing when enabled or not, I only saw coming soon, is this the case? (ReplicateInstanceDestroySetting
)
The reason why I would like a function to check if it has been destroyed is that we had an issue in a semi-popular shooter game where we used an object pool to reuse instances that had some issues with destroyed objects.
This object pool occasionally returned destroyed instances, even though we could not see any reason for why it would. It ended up with us doing a duct tape check with attempting to set Parent wrapped in a pcall to detect if the Instance had been destroyed, with a proper IsDestroyed() check it would have become a much more clean solution.
Edit: The event should probably mitigate situations like we had, but hard to predict beforehand in which cases an âIsDestroyed()â check could be useful. Especially with deferred events.
My question is not where itâs located, but if itâs enabled in-game when the setting is on, or whether itâs only for testing in studio at the moment.
Whether this change is on or not is decided by the property ReplicateInstanceDestroySetting
of Workspace
. If you set this to Enabled
, then Destroy() will be replicated in live games.
No, CollectionService
only tracks stuff thatâs in the DataModel.
Soundâs good! Shouldâve been default to begin with. Iâm going to test on all my games
It appears that the Default behavior is currently Enabled. This change broke our game in new servers. I had to go in just now and change it to Disabled in order to restore the gameâs functionality.
Yes, we are so sorry for this problem. This has been fixed very recently, you should no longer see Default behavior as currently Enabled.
I love this change a lot! Also could you guys add a property that indicates if is destroyed or not?
The only detail I am missing that could be useful is a IsDestroyed() function to check if an Instance has been destroyed or not.
A solution for this can be to just check if the instance has a parent, i.e:
if not Instance.Parent then
-- im ded
end
Yes finally! good update for me!
This could be problematic for my custom replication, please give advice:
My problem is that I need to be able to take a model from the server, replicate it to a specific client, and then clean up that model from only the server (essentially âdownloadingâ the model from the server to a client, making that model entirely local to that client and nowhere else including the server).
The way I currently approach this is extremely hacky, but what I do is the following:
Now, would it be possible for me to simply set the parent of the model to nil on the server and remove references to said model from the server to clean it from server memory without interfering with the client? I assume this would work, but I have not tested it. I currently use Destroy(), and with this new change my replication will break.
If youâve moved the object around to a different place on the client. I believe any calls for the server to Destroy said object doesnât exist in the clientâs exact Data-model location anymore.
Have you attempted to toggle the feature from workspace properties?
I think you have a couple of options here that I can immediately come up with:
Destroy()
-ing an Instance will not replicate if the Instance is not a descendant of a replicated service. So, you could do something like reparenting the Instance to nil
or ServerStorage
before calling Destroy()
to prevent the Destroy()
from being replicated.Destroy()
on the original, the clone the Client is using wonât be impacted.Oh, those are both very good solutions. So if I move a model to a non-replicated container, it is âdetachedâ from the client copy in a sense?
I appreciate the help!
Finally! Iâm glad this is finally almost out. I remember seeing the .Destroying event in the v500 changelog and Iâm glad itâs finally almost here.