Bug with player:LoadCharacterAppearance and large accessories (large hair as example)
Calling player:LoadCharacterAppearance(accessory) on a character smaller than the accessory itself forces the whole character to be teleported to (seemingly) the accessory’s Handle’s default position.
This appears to be caused by the size difference of the Accessory vs the Character, as it happens when I use :LoadCharacterAppearance() on the Father Time Hair, but not a small hair, like Pal Hair
This is very annoying for me, as my game uses a custom character which is only the HumanoidRootPart, Torso, and Head, and manually loads in accessories using :GetCharacterAppearanceInfoAsync(), followed by :LoadCharacterAppearance, on select accessory types.
Repro steps:
-
Create a StarterCharacter consisting of a Humanoid, HumanoidRootPart, Torso, and Head. No Accessories by default. For this example, include a “HairAttachment” and “HatAttachment” in the Head part, position as needed. Leave the sizing of the parts roughly the same as a regular R6 or R15 character would have them.
-
Using InsertService, Insert Pal Hair and Father Time into workspace.
-
Press Play, and use player:LoadCharacterAppearance on the Accessory for Pal Hair
-
Notice no issues with loading, as Pal Hair is very small.
-
Delete the Pal Hair from the Character, and use player:LoadCharacterAppearance on the Father Time Accessory.
-
Notice the character gets teleport to a different location, however the location does not change every time you do this, it is always the same.
-
Now, Stop and resize the StarterCharacter about 10x as large, load the Father Time Accessory back into the character.
-
Notice no teleporting, as the character is larger than the accessory, therefore the AccessoryWeld does not cause undesired movement on the Character.
I may be wrong on the exact cause of this, however I believe modifying the player:LoadCharacterAppearance function to reposition the Accessory’s handle to the player character’s position before actually parenting it to the character.
This is my current workaround, which I believe should be handled by :LoadCharacterAppearance itself.
if accessory and accessory:FindFirstChild("Handle") then
accessory.Handle.Position = player.Character.PrimaryPart.Position
end
player:LoadCharacterAppearance(accessory)