player:LoadCharacterAppearance on large accessories causes teleporting on small characters

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:

  1. 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.

  2. Using InsertService, Insert Pal Hair and Father Time into workspace.

  3. Press Play, and use player:LoadCharacterAppearance on the Accessory for Pal Hair

  4. Notice no issues with loading, as Pal Hair is very small.

  5. Delete the Pal Hair from the Character, and use player:LoadCharacterAppearance on the Father Time Accessory.

  6. 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.

  7. Now, Stop and resize the StarterCharacter about 10x as large, load the Father Time Accessory back into the character.

  8. 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)
4 Likes

Just enabled something that might fix this on fresh servers. Let me know if this is still happening on new servers.

2 Likes

It appears to have worked, thanks!! :smiley:

We just had to revert the change we enabled that fixed this previously. Unfortunately you’ll have to stick to the workaround for now.

When a part is welded to another part one of the parts has to move. So the part that isn’t already connected to root usually moves. Larger parts are more likely to be root, with some other complex rules (like HumanoidRootPart has a multiplier). That’s why large accessories can cause the character to move.

I’ll pass this along to the Avatar team to see if they can take care of this in LoadCharacterAppearance like you suggested.

1 Like

Thanks, will uncomment my workaround for now.

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