R15 bodyparts are deleted/replaced after CharacterAdded

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. ¯\_(ツ)_/¯

3 Likes

Shippin’ bugs every day!

8 Likes

Does this (possibly) mean R15 will switch to using SpecialMeshes then? :grin:

Likely not. From what I can tell, ROBLOX is trying to deliver a “what you see is what you get” sorta deal when it comes to characters and physics.

I kinda like this because if I wanna dress up like an elephant, the game will treat me like one too. Something about that is endearing to me.

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.

1 Like

If R15 uses mesh parts & each package has different physics/weights/sizes then I’m going to throw up

5 Likes

Would it help if they extended the idea behind BasePart:GetMass to models?

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.