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
4 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 — 4y

1 answer

Log in to vote
0
Answered by
Ziffixture 6913 Moderation Voter Community Moderator
4 years ago
Edited 4 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.

local TexturedParts = workspace.TexturedParts:GetChildren()

for _,Part in pairs(TexturedParts) do
    local Texture = Part:FindFirstChildOfClass("Texture")
    if (Texture) then
        Texture.Transparency = 0
    end
end
Ad

Answer this question