After ‘CharacterAppearanceLoaded’, if you set a body part color, the color becomes out of sync with the client.
You can use the following example to reproduce the issue.
game.Players.PlayerAdded:Connect(function(player)
player.CharacterAppearanceLoaded:Connect(function(character)
local head = character:WaitForChild("Head")
head.BrickColor = BrickColor.Green()
end)
end)
The server will have my head green, and the client will use the color from my avatar settings. I’m able to reproduce this 100% of the time. It happens in studio (toggle client / server to see the different head colors) or in a game server, using the console to show head color.
If I change a property of ‘Body Colors’ instead, the color will be synced up in this simple test case.
game.Players.PlayerAdded:Connect(function(player)
player.CharacterAppearanceLoaded:Connect(function(character)
local bodyColors = character:WaitForChild("Body Colors")
bodyColors.HeadColor = BrickColor.Green()
end)
end)
However, in a place with many assets and scripts. Changing the part directly, Body Colors, or both resulted in client server being out of sync. I could reproduce this 100% in that place.
As a workaround I watched for a change to the BrickColor property and flipped it back as soon as my change was overwritten by ???
player.Character.Head:GetPropertyChangedSignal("BrickColor"):Connect(function()
head.BrickColor = BrickColor.Green()
end)
So Changes to character appearance are still occurring after CharacterAppearanceLoaded.
Can we have this event not fire until after the changes are complete? If not, can we have a flag we can check on ‘Body Colors’ that lets us know when it has stopped making changes?
Additional findings:
If you set a body part color immediately after CharacterAppearanceLoaded on the server , it will be overwritten client-side with the avatar’s body part color. This only happens if the user’s avatar is wearing any bundle on any body part except their head or right arm. There is no effect on the issue if the avatar wears a Head or Right Arm, but wearing a bundle on any other body part will fix the problem.
- No effect on desync with head bundle or no package
- No effect on desync with right arm bundle or no package
- Desync fixed with left arm bundle
- Desync fixed with torso bundle
- Desync fixed with right leg bundle
- Desync fixed with left leg bundle
The correct behavior only happens when you are wearing a bundle for one or more of:
- Left arm
- Torso
- Right leg
- Left leg
Loosely put, any avatar without a bundle (AKA default blocky) will experience this issue.