Is there a difference between findFirstChild and FindFirstChild? and when should I use WaitForChild over FindFirstChild and vice versa

Is there a difference between findFirstChild and FindFirstChild? and when should I use WaitForChild over FindFirstChild and vice versa?

findFirstChild is deprecated iirc, use FindFirstChild for performance reasons.

FindFirstChild is to be used when you’re 100% sure that the object that you’re looking for exists when the game loads. WaitForChild is to be used when something gets added in later or takes a bit to load in.

2 Likes

Is there a way to compare there performance?

There is no performance difference between the two, roblox just wants to push PascalCase over camelCase in method names

2 Likes

Whats Pascalcase and camelCase

PascalCase
camelCase
Do you see the different capitalization of letters

1 Like

So capitalized over Lowercase?

FindFirstChild -- PascalCase
findFirstChild -- camelCase
local p = Instance.new("Part")
print(p.findFirstChild, p.FindFirstChild) --function: 0x1189d15a5d97f516 function: 0x20a200e0ca5ae836

The former is deprecated the latter is not.

1 Like