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

Is there an easier way to make multiple textures transparent?

Asked by
JPT79 92
5 years ago

So I've made some simple falling platforms, when they fall the make an invisible clone where they used to be and fall into the void, a few seconds later the clone becomes visible. That all works fine, but I recently added a custom texture and realized that since they have their own transparency they won't turn transparent with the part, do I have to really have to write line for every single individual texture or is there a more efficient way to accomplish this?

0
Personally I would have the textures tagged with CollectionService and change them all at once using :GetTagged Azuc 112 — 5y

1 answer

Log in to vote
0
Answered by
Ziffixture 6913 Moderation Voter Community Moderator
5 years ago
Edited 5 years ago

You can reiterate via a pairs loop through each Texture and set their transparency that way. The code below is a theoretical example, you’ll have to modify it to your liking as you have not provided your own program.

1local TexturedParts = workspace.TexturedParts:GetChildren()
2 
3for _,Part in pairs(TexturedParts) do
4    local Texture = Part:FindFirstChildOfClass("Texture")
5    if (Texture) then
6        Texture.Transparency = 0
7    end
8end
Ad

Answer this question