#How do I use FindFirstDescendant?
1 messages · Page 1 of 1 (latest)
Idk man, just make a function that loops through descendants and returns the first name match yourself
Still tho, would save a few lines.
Yeah but I don't think it's a good idea to do that in general
What system are you making?
FindFirstChild("thing", true) should work same way
You cannot use it in production at this time
Stick to FindFirstChild's recursive argument
Why can I not use humanoid move to on this model?
@median folio You can use :QueryDescendants()
API Documentation: https://create.roblox.com/docs/reference/engine/classes/Instance#QueryDescendants
Example code from the Documentation: ```lua
local Workspace = game:GetService("Workspace")
-- Get all MeshPart descendants
print(Workspace:QueryDescendants("MeshPart"))
-- Get all descendants tagged as "Fruit"
print(Workspace:QueryDescendants(".Fruit"))
-- Get all descendants with the name "RedTree"
print(Workspace:QueryDescendants("#RedTree"))
-- Get all descendants with CanCollide property set to false
print(Workspace:QueryDescendants("[CanCollide = false]"))
-- Get all descendants with a "FuelCapacity" attribute assigned
print(Workspace:QueryDescendants("[$FuelCapacity]"))
-- Get all descendants with a "FuelCapacity" attribute set to 75
print(Workspace:QueryDescendants("[$FuelCapacity = 75]"))
How come I haven't seen anyone use it in 2-3 years of scripting lol
Did they introduce it recently?
Yep
Recently came out
it's honestly very nice
Agreed
Can get a bit weird / messy tho, but it's for the better good