I'm trying to use a loop to slowly increase a model's transparency. How would I go about doing that?
✓ ANSWER ACCEPTED
How to slowly fade out a model?
1 answer
✓ Accepted answer
local FadeModel_Out = function(ModelEntity, Speed)
-- Put your supported Instance's that have Transparency property
local SupportedTypes = {
'Part';
}
if ModelEntity:IsA("Model") then
local Entities = ModelEntity:GetDescendants()
for _,OBJ in next, Entities do
for _,Type in next, SupportedTypes do
if OBJ:IsA(Type) then
spawn(function()
repeat
OBJ.Transparency = OBJ.Transparency + 0.1
wait(Speed)
until OBJ.Transparency == 1
end)
end
end
end
end
end
FadeModel_Out(workspace.Model, .01)
-- Arguement[1] Is your model directory path.
-- Arguement[2] Is your speed you want it to fade at.
I hope this helps your needs!
This discussion is preserved as it was. New answers, comments, and votes are closed.

3 comments
Wow. This is actually pretty clever. I thought I had to use a 'for' loop on all the parts of a model, but of course it could be a lot of parts. I might use this one day! Thanks!
While I'm glad you help people, please don't spoonfeed code like you did here since people don't learn from this.
Thank you for the help but I don't really understand how this works. Do I have to set a variable for "Speed"?