Tweening bodypart colours causes clothing to glitch out on other players

hello,

for i,v in pairs(workspace:GetDescendants()) do if v:IsA("Part") and v.Parent.Name == "WindBrine" or v:IsA("Part") and v.Parent.Name == "WindBrianne" then game:GetService("TweenService"):Create(v, TweenInfo.new(1), {Color = Color3.fromRGB(255,255,255)}):Play() end end

I am using a simple for loop to tween the body part colours of 2 players ingame towards a similar color.
However if this is done at the same time on multiple players the clothes start to glitch out like so:

RobloxPlayerBeta_nnTQVL2bG5

I tried doing this through both client and server, but nothing seems to work.
I wish to know if there is a way around this or a better way to handle smoothly changing part colour which does not cause this issue.

This ONLY happens when tweening more than 1 player a the same time. Also seems to overlay the face decal aswell.

1 Like

First of all, I don’t recommend looping through the workspace using GetDescendants(). Instead use this,

for i,Player in pairs(game.Players:GetPlayers()) do
	if not Player.Character then continue end
	local Character = Player.Character
	for i, BodyPart in pairs(Character:GetDescendants()) do
		if not v:IsA("Part") then continue end
		--Insert rest of code
	end
end

What part is WindBrianne?

1 Like

I am doing the loop as a test, it is properly optimized in the main script and I apologize for not mentioning it,

WindBrianne is the second player used for testing, WindBrine is the first one.

Both the normal script and the loop I used as an example return the same results with the glitching.

1 Like

So, it seems that in every Player Character, there is an instance called Body Colors that you can use to change the color of body parts. Try to tween these properties.
image

1 Like

Unfortunately it did not help, the clothes still have an issue staying where they should be.

1 Like

Well, it seems to be lag that is making the clothes change a lot. R6 models have less of that glitchiness.

1 Like

Unfortunately there’s no lag involved, and I am using R6 models.

1 Like

I don’t see anything strikingly wrong with your script. Like @striker2783 mentioned, you could certainly handle this more efficiently, but tweening the colors of parts should not constitute a dramatic clothing change. Could you show us more of the script?

2 Likes

Sorry for being late, but that is quite literally all of the script. The one I included in the original post causes the exact same results as the one I am primarily using, the only difference being is that all body parts are originally predefined instead of checking them through a loop. (Character.Head, Character[“Right Arm”] etc).

local HT = TweenService:Create(Character["Body Colors"], TweenInfo.new(3), {HeadColor3 = Color3.new(1, 1, 1)}) HT:Play()
example from the main script where i tried it with body colors.

1 Like