Instance:GetLinked()

I do not know if this request has been made before, as I did not find anything similar.


Instance:GetLinked() :: {Instance?} would be a pretty neat addition. It would work similar to GetChildren(), however it will return only Instances that are connected to them by Instance setting properties, like the only purpose of an ObjectValue.
For example:

  • say I want to call workspace.CurrentCamera:GetLinked(), the function will return all the ViewportFrames connected to it, if any, through the ViewportFrame.CurrentCamera property,
  • same for ObjectValues above,
  • or get all the instances that are the Adornee of something.

I hope more people would find a need for this, because I certainly would’ve loved this right now.
Sure, you can do it with a module and a lookup table, but that would require to loop through game:GetDescendants(), which becomes unnecessary.


It’s worth mentioning that a GetLinkedAttributed() would also be great due to the recent addition of InstanceHandle.

5 Likes

even though i wouldnt really find a need for this for sure it would be useful in some other projects

+1 bump hopefully roblox adds this