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
?
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