The usage expected would be exactly the same of the second parameter of FindFirstChild, where if true, it will search recursively throughout the objects.
Might I add that it is the only of its kind that does not have the recursive parameter.
Wait, wouldn’t FindFirstChildWhichIsA be the recursive version of FindFirstChildOfClass, since they both take className as the first arg. If they made FindFirstChildOfClass have recursive then those 2 would pretty much do the same thing?
Well I know that. But they both take ClassName as the first argument. Thus, FindFirstChildWhichIsA can return what FindFirstChildOfClass can return, but the “WhichIsA” version is recursive so we could use that instead of the “OfClass” version.
Depends on the use case. Sometimes you can’t use WhichIsA, such as capturing Decals instead of Textures and Parts instead of Seats/SpawnLocations. They’re far and few between but they exist.
MeshParts, Parts, Trusses, Wedges (I believe) and other objects are members of the BasePart class. If you want to easily check for different types of parts you can do “:IsA(“BasePart”)” instead of “:IsA(“Part”) or :IsA(“MeshPart”) or :IsA(“TrussPart”)…” etc
This is useful for other stuff too like GUI objects (GuiBase)
I’ve used :IsA(“BasePart”) plenty of times when using recursive before attempting to use a property only baseparts have such as brickcolor and position.
Perhaps they should add recursive to FindFirstChildOfClass just so all 3 of them have it. Keeps things consistent and you never know when someone might prefer “OfClass” over “WhichIsA”.
Bumping because this is still needed. Why is FindFirstChildOfClass the only form of FindFirstChild without a recursive parameter? It’s baffling.
:IsA plainly isn’t functionally equivalent to checking the ClassName. If I’m searching for an instance that matches a specific class, I don’t want my efforts to be thwarted by another instance that so happens to inherit from the class I’m actually looking for. I also can’t always foresee how inheritance will change in the future. When I’m working with my own systems, I know exactly what classes comprise its components. Strictly evaluating by ClassName in these cases, will always be more reliable than settling for :IsA. But that would be humoring the notion that these approaches are functionally comparable; when in fact again, “WhichIsA” is simply not a substitute for “OfClass”.