Setting text transparency properties to themselves becomes invisible

I am certain that this is a bug with the engine itself.
Using this code:

local transparency = {}
for _, item in pairs(section:GetDescendants()) do
	local propAllowed = {}
	local propWL = {"BackgroundTransparency", "TextTransparency", "Transparency"}
	
	for _, prop in pairs(propWL) do
		local s = pcall(function()
			item[prop] = item[prop]
		end)
		
		if s then
			propAllowed[#propAllowed+1] = prop
		end
	end
	
	transparency[item] = propAllowed
end

makes text on TextButtons and TextBoxes become invisible, despite waiting 10 seconds beforehand. The code is supposed to check if certain properties are allowed when looping through all ui objects in the ScreenGui, and it works for all properties besides TextTransparency, it seems.

Does your gui object have an invisible BackgroundTransparency? If so, this isn’t a bug, when a GuiObject’s BackgroundTransparency is 1 and its TextTransparency is 0, the Transparency property will be 1.

Then, consequently, when you write to the Transparency property (which you’re doing here: item[prop] = item[prop], it overrides both the TextTransparency property, and the BackgroundTransparency property, which would have set the TextTransparency to 1, even though the property value is the same.

You should remove the Transparency field from your table.

2 Likes

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.