How to get parts from a model one by one?

I know how to get all parts from a model but, how can I get them in order? for example making them go invisble one by one

1 Like

You can probably use GetChildren on the model for that case

for _, part in ipairs(model:GetChildren()) do
    part.Transparency = 1
end

IF the model has something that isn’t a part, you will need to use a if part:IsA("BasePart") if statement then put the invisible code there

this would make all the parts invisible instantly

You can put a wait after the transparency line so it does it at a certain interval. Want it to wait a second after making 1 part invisible? wait(1)

1 Like

You’d need to use tween Service on the Transparency so something like this:

local TweenService = game:GetService("TweenService")
local goal = {}
goal.Transparency = 1
local tween = TweenService:Create(part,TweenInfo.new(5),goal)
tween:Play()
1 Like
local model = script.Parent

children = model:GetChildren()

for i,v in pairs(children) do

if v:IsA("BasePart") then v.Transparency = 1

wait(0.5) --every 0.5 waittime a part will be invisible.

end

end
1 Like
local tweenService = game:GetService("TweenService")
local info = TweenInfo.new(1, Enum.EasingStyle.Linear)

for _, v in pairs(scipt.Parent:GetDescendents()) do
     if v:IsA("BasePart") then
          local tween = tweenService:Create(v, info, {Transparency = 1})
          tween:Play()
          wait(1)
     end
end

--put into the model

2 Likes

Use :GetChildren() please. Hope that helps.

1 Like