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

Whenever I try to use the function "GetDescendents()" I get an error. How do I fix this?

Asked by 2 years ago

The code I am using is the following:

for i, object in ipairs(newMob:GetDescendents()) do if object:IsA("BasePart") then PhysicsService:SetPartCollisionGroup(object, "Mob") end end

GetDescendents() always gives me this error " GetDescendents is not a valid member of Model "Workspace.Mobs.Mech"" no matter how many times I tried to fix this I never get close. Thanks.

1 answer

Log in to vote
0
Answered by
enes223 327 Moderation Voter
2 years ago
Edited 2 years ago

It's a typo, you need to type "GetDescendants" not "GetDescendents".

https://developer.roblox.com/en-us/api-reference/function/Instance/GetDescendants

Ad

Answer this question