I’m fairly confident this happens because Player.CharacterAdded is fired before packages are done loading.
And because R15 packages replace existing body parts from the original code,
Lua code like the following does not work as expected when the character is wearing a package that changes the right arm:
local function onCharacterAdded(character)
local rightUpperArm1 = character:WaitForChild("RightUpperArm")
wait(1)
local rightUpperArm2 = character:WaitForChild("RightUpperArm")
print(rightUpperArm1 == rightUpperArm2) --> false
end
LocalPlayer.CharacterAdded:connect(onCharacterAdded)
This also applies for LocalPlayer.CharacterAppearanceLoaded as well.
I’m actually probably the one to blame for this. ¯\_(ツ)_/¯
All packages are humanoid shaped though – no elephants unfortunately. In this regard, all package collisions should be standard. It’s not too fun being unable to fit through doors in your package that has wings attached to the torso that make you 7 studs wide.
It looks like this works with CharacterAppearanceLoaded. I still think it might be a good option to move CharacterAdded signal though.
This is the code I’m trying:
local LocalPlayer = game.Players.LocalPlayer
local function onCharacterAdded(character)
LocalPlayer.CharacterAppearanceLoaded:wait()
local rightUpperArm1 = character:WaitForChild("RightUpperArm")
wait(1)
local rightUpperArm2 = character:WaitForChild("RightUpperArm")
print(rightUpperArm1 == rightUpperArm2) --> true
end
LocalPlayer.CharacterAdded:connect(onCharacterAdded)
Ah, I remember now. The no-package R15 is loaded by default, and then when the appearance is loaded those existing body parts need to be replaced with new body parts since there’s no way to change MeshPart meshes. That makes a lot more sense.
Though, unlike R6, R15 waits to spawn the character until the entire appearance has loaded. I’m not sure we need to create the no-package character and fire CharacterAdded until we know the character’s appearance, since the character isn’t being spawned in the meanwhile.