Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

Is there a difference between "FindFirstChildWhichIsA" and "FindFirstChildOfClass"?

Asked by 3 years ago

I'm trying to check if a Part's parent is a Humanoid, but I want to know which one is the one I should use and is the most efficient/useful. So is there an actual difference between FindFirstChildWhichIsA and FindFirstChildOfClass?

1 answer

Log in to vote
1
Answered by 3 years ago
Edited 3 years ago

FindFirstChildOfClass() returns the child of a specific class. FindFirstChildWhichIsA() returns the child of a specific class or any class inherited.

This means that FindFirstChildWhichIsA() can be used to get an object which is not directly any specific class.

For Example:

MeshParts, Parts and Unions are all part of the “BasePart” class inheritence meaning that FindFirstChildWhichIsA(“BasePart”) will return an object which can be either of those classes.

If you want need to choose either one of them for your script, I suggest using :FindFirstChildOfClass

Ad

Answer this question