Although it may not be the most needed listener, I’d really like to see it added. Right now I am working on a plugin that produces a changelog and I don’t want to be connecting changed to 10,000 instances, when instead I could be connecting to just one. Not to mention I am sure other users would be able to make use of this to make sure if they are not using filtering enabled that their game is not being tampered with.
Furthermore, it’d be great to get a second argument for both this and changed which would pretty much be the client or server that made the change.
I’ve not got much time, hence the kind of sketchy outline, so I hope I’ve explained adequately enough.
I could only imagine the number of changed events happening continuously in-game if this was to be implemented…
.DescendantChanged( bool Recusive (default false) )
In this thread
The difference between Child and Descendant
Not sure it’s worth the engine having to watch for so many changes. Why not make a single recursive function and hook up changed events to all the objects? Then use DescendantsAdded/Removed to add/remove events as needed?
Events are automatically disconnected when an object is destroyed, I believe.
Surely it makes more sense to have one listener, than 1,000?
Think of what’s going on in the background. .
Well, in the end you still have to connect all the events. So if you want to keep track of what object is being changed, you’re still going to have a lot of functions to feed into one major one. One example:
function DescendantChanged(obj, prop)
-- Initial scan to draw in all descendants:
local function Scan(parent)
for _,v in pairs(parent:GetChildren()) do
Isn’t there already something along the lines of Game.ObjectChanged? I think that’s the same thing as this, but for the data model.