Instance:GetChildrenOfType(ClassName:string)

As a roblox developer it is currently a bit time taking to get all the instances of one type inside of another instance. You have to loop through each instance and then check if instance is of the type you want then add them into a table so it’s easier further on in the script. This is just a hassle most of the time!

My idea is to have a new method named: Instance:GetChildrenOfType() or Instance:GetChildrenOfClass(). Kind of like how Instance:FindFirstChildOfClass() or Instance:FindFirstChildWhichIsA() but rather than returning a single instance, these return a table with instances. There could be methods for Descendants as well like: Instance:GetDescendantsOfClass()

This isn’t something big, I know, but I think it would make developing stuff more cleaner. Just like how math.lerp isn’t something big yet it makes development cleaner and saves a few lines.

Thanks! I hope that this gets added soon.

1 Like