CollectionService on the Descendants of an Object

As a Roblox developer, it is currently too hard to use CollectionService within only one object.

Often, tag-related programming should only apply to instances loaded into a specific place, such as Workspace. I don’t want the programming applying to my maps in ServerStorage, for example. There is no easy way to do this at the moment, as CollectionService’s methods apply to the whole game.

Scenarios:

  • Get all tagged instances that are a descendant of an object
  • Detect when a tagged instance is parented to an object from nil
  • Detect when a tagged instance is parented to an object from some other object
  • Detect when a descendant is given a tag
  • The reverse of the last three, for when tagged objects or tags are removed

Doing these right now requires a complicated mix of DescendantAdded, DescendantRemoving, GetInstanceAddedSignal, GetInstanceRemovedSignal, GetDescendants, and HasTag.

Ideally these would be as easy as

  • GetInstanceAddedSignal(tag, instanceAncestor)
  • GetInstanceRemovedSignal(tag, instanceAncestor)
  • GetTagged(tag, instanceAncestor)

…or something similar with new names.

If Roblox is able to address this issue, it would make it easier to program behavior for tagged objects that only applies under certain ancestors.

9 Likes