Characters' Clothes Seem to be Swapping and Changing Colours when Tweening Transparencies

When tweening the characters’ transparencies to make them fade in and out, their clothes appear to be swapping and changing colour rapidly.

Video of issue:

Here’s the code I used to tween the characters’ transparencies:

local function fadeChar(char, fadeDirection)	
	local tweenInfo = TweenInfo.new(1, Enum.EasingStyle.Linear, Enum.EasingDirection.Out)

	if fadeDirection == "In" then
		for index, object in pairs(char:GetDescendants()) do
			if object:IsA("BasePart") and object.Name ~= "HumanoidRootPart" or object:IsA("Decal") then
				local tween = game:GetService("TweenService"):Create(object, tweenInfo, {Transparency = 0})
				task.spawn(function()
					tween:Play()
				end)
			end

		end
	elseif fadeDirection == "Out" then
		for index, object in pairs(char:GetDescendants()) do
			if object:IsA("BasePart") or object:IsA("Decal") then
				local tween = game:GetService("TweenService"):Create(object, tweenInfo, {Transparency = 1})
				task.spawn(function()
					tween:Play()
				end)
			end
		end
	end	
end

I used this same function in another module function without any issues so this is really weird. Also, if only one character is generated, I don’t get this issue.

Code snippet of code used to create characters from the player’s friends list:

        local fanNumber1 = math.random(1, #currentPage)
		local fanNumber2 = math.random(1, #currentPage)
		local fanNumber3 = math.random(1, #currentPage)
		local fanNumber4 = math.random(1, #currentPage) 

		for count = 1, #currentPage do
			local userId = currentPage[count].Id

			if count == fanNumber1 then
				local charGen

				local success = pcall(function()
					charGen = game.Players:CreateHumanoidModelFromDescription(game.Players:GetHumanoidDescriptionFromUserId(userId), Enum.HumanoidRigType.R15)
				end)

				if not success then
					charGen = game.Players:CreateHumanoidModelFromDescription(game.Players:GetHumanoidDescriptionFromUserId(player.userId), Enum.HumanoidRigType.R15)
				end
				
				table.insert(fanTab, charGen)
			end
-- Etc

Code snippet of when the fade function is used:

for index, char in pairs(fanTab) do
		fadeChar(char, "In")
		
		task.spawn(function()
			task.wait(4)
			fadeChar(char, "Out")

			task.wait(1.5)
			char:Destroy()
		end)
	end

Any help is appreciated. Has anyone encountered this issue? Is it a bug? Does anyone know how to fix this? Thanks.

1 Like

What exactly is the issue? Can you point it out to me in that video, please? I might be missing something, so bare with me.

1 Like

This is how transparencies are rendered. If it’s an issue for you, use the Glass material for everything.

1 Like

Look at the back left character, can you see that the clothes and colours are changing as their transparencies are being tweened? (At the beginning of the video)

1 Like