For the purposes of what I'm working on, I need all the parts of the player's character (head, torso, upper arms, lower legs, etc...) to fade out simultaneously. As far as I know, using coroutines would be the best way to go about this.
The problem I'm having is that there are 16 parts to the character's body, and to create a coroutine for each part to fading it to transparent seems sinfully ineffective.
To demonstrate what I mean, if I were to just want to fade out the Head and the UpperTorso, I would do this:
local fadeHead = coroutine.wrap(function()
for i = 1, 25 do
wait(0.05)
head.Transparency = head.Transparency + 0.04
end
end)
local fadeTorso = coroutine.wrap(function()
for i = 1, 25 do
wait(0.05)
upperTorso.Transparency = upperTorso.Transparency + 0.04
end
end)
fadeHead()
fadeTorso()
... and I'd be happy.
However, I would really like to know if there's a more efficient way of going about doing that for more than two or three items, at which point the code just becomes pretty horrid to behold.
I've tried a couple things - none of which I expected to work nor did.
Any suggestions are appreciated.
Thanks!

1 comment
Brilliant! Exactly what I needed, and more for learning's sake. Thank you for taking the time to write such a helpful and comprehensive answer.