Why does this script only work with R15?

I’m wanting my R6 game to remove all bundles from the character, to force them to be blocky, whilst keeping their accessories and clothing.

I have this script that works with R15, helped from another developer forum post, but it doesn’t work with R6, and I can’t find out why.

I’ve looked a while over the internet and didn’t find another solution working for me.

Here is the server script

local Players = game.Players

function PlayerJoined(Player)
	local function RemoveMeshes(Character)
		local Humanoid = Character:WaitForChild("Humanoid")
		wait()
		local CurrentDescription = Humanoid:GetAppliedDescription() 
		
		CurrentDescription.Head = 0
		CurrentDescription.Torso = 0
		CurrentDescription.LeftArm = 0
		CurrentDescription.RightArm  = 0
		CurrentDescription.LeftLeg = 0
		CurrentDescription.RightLeg = 0
		Humanoid:ApplyDescription(CurrentDescription) 
		
	end
	Player.CharacterAdded:Connect(RemoveMeshes)
end

Players.PlayerAdded:Connect(PlayerJoined)

Anything helps! Thanks! :slight_smile:

4 Likes

I believe humanoid descriptions were added just this year. So its entirely possible that it is intended mostly for the R15 rig. I also could not find any info on this. What happens when you use on an R6?

This sounds like a bug to me. I’m not sure why this would happen. Try removing any CharacterMesh instances from the player before calling ApplyDescription?

Not able to reproduce any issues, code worked fine for me.

HumanoidDescriptions work with both R15 and R6 rigs. There’s no reason why it wouldn’t work for R6 rigs, given that support for them has not been dropped. HumanoidDescriptions fetch assets assigned to each field and accordingly apply them to the rig.

The problem here is that your code runs before a character’s appearance is fully loaded, so the default HumanoidDescription for the avatar is overwriting your package remover. CharacterAdded does not guarantee that a character will have their appearance loaded, only that their character has been added to the DataModel. Use CharacterAppearanceLoaded before applying new assets to a character.

6 Likes

Actually this makes me think… Does your character have packages? If not, I think this points even more to the CharacterMesh instance.

I do have a character with packages. Even if I don’t have one, I can make one and test the code, which is exactly what I did for this scenario.

R6 avatars have their packages applied via the CharacterMesh instance so removing those would “depackage” a character. Better to just fix the HumanoidDescription method though, especially if you’re accounting for both rig types in a player choice environment where, unless you read RigType off the Humanoid, don’t know what type of rig a character uses.

If you directly remove CharacterMeshes, it’s pointless to use HumanoidDescriptions. You’d also have to account for the Head mesh which is in the Head itself, not as a CharacterMesh.

1 Like

That is my point. I think the issue the OP is facing is due to the CharacterMeshes. I’m not sure though we’ll have to wait on a response from them to clarify the issues they are experiencing.

How are the CharacterMeshes a problem? Applying 0 values to a HumanoidDescription removes them from the character model. See:

Copy the function RemoveMeshes and run it with your character model as an argument in Studio under the server view. Don’t remove any CharacterMeshes. You will get depackaged.

1 Like

Thank you. Using CharacterApperanceLoaded seemed to fix it!