I have read many times the wiki about both and i couldnt get the difference, can someone explain me?
It’s clearly stated on the wiki page.
Unlike
Instance:FindFirstChildOfClass
, this function usesInstance:IsA
which respects class inheritance.
FindFirstChildWhichIsA
accounts for super and base classes instead of singular classes (“Part”, “Union”, etc)
FindFirstChildOfClass
only gets a child with a certain class
-- code sample
local basePart = workspace:FindFirstChildWhichIsA("BasePart") -- gets any child under this super class
local part = workspace:FindFirstChildOfClass("Part") -- you wouldn't be able to use "BasePart" here
FindFirstChildWhichIsA()
respects inheritance while FindFirstChildOfClass
does not. Instances can be inherited from one another. Example would be a Part. A Part’s Class is “Part”, but it’s inherited from another Instance called “BasePart”. If you do FindFirstChildOfClass("BasePart")
, it will not find the part. However, if you do FindFirstChildWhichIsA("BasePart")
, it will find the part since it respects inherited instances.
Also, methods with “IsA” in the name specifies that it respects inheritance. It is a common practice.