so everyone knows we can use game:QueryDescendants() but this doesn’t solve DescendantAdded checks
game:QueryDescendantAdded("ScreenGui"):Connect(function(gui)
print(gui.ClassName) --always screengui no need to have filter check for classnames
end)
game.DescendantAdded:Connect(function(inst)
if inst.ClassName~="ScreenGui" then
return
end
print(inst.ClassName) --always screengui too, but it needs a filter classname check
end)
why this then? I think QueryDescendantAdded would be more optimized than listening for every new descendant since the engine would handle it on its c++ side instead of having luau checks
This is a similiar problem to object.Changed that was resolved with object:GetPropertyChangedSignal(“Name”) that’s why i want an engine solution for this specific problem
Shut up coza how would they even add that where are you going to pass the query into they’d need to add a new Connect member and make it work on things other than the Added archetype or else it would be bloat and garbage. Knowing them they’d probably use Instances for it too. Or how about some new slop like an Object. Yeah let’s just have a completely new constructor for querying that sounds like an excellent idea. I think we all need that. I’m all for it I want that. They should make it only work with deferred events and server authority for no reason. I need this in my life. I think I’d actually give not one but two of my kidneys for it that’s just how desperate I am I just need more abstraction just give it to me please.
but you cannot connect to ChildAdded event without having that pesky if child.ClassName==“blabla” check
thats the entire point of this post and same issue was resolved before with object.Changed because roblox added object:GetPropertyChangedSignal instead