Removing existing Body bundles?

Hi, was wondering if there were a way to remove a Players Body on Enter / Respawn?
Characters will be R15 and ideally have the default blocky package however I can’t seem to find a way to remove packages.

Thank you!

2 Likes

You could create a table of the mesh IDs of the default R15 package and when a player joins, iterate through their character and set each body part to the corresponding mesh ID.

Edit:

local DefaultPackage = {
    [“RightUpperArm”] = MeshID
}

for i, v in ipairs(Character:GetChildren()) do
    if v:IsA(“BasePart”) then
        If v.Name == “RightUpperArm” then
            v.MeshId = DefaultPackage.RightUpperArm
        end
    end
end

I typed this on my phone

1 Like

I have an error thrown out each time.
Seems that I’m unable to edit the Id of a MeshPart in game?

Hmm, after reading the wiki, you actually can’t change the mesh ID of mesh parts on runtime, sorry about that :grimacing:

Edit:


(Credit to @colbert2677 for the photo)

You can set the individual package ID of the body parts in the avatar section of the game settings.

4 Likes

Thank you! I’m having issues locating the IDs for the default Blocky-body.

Perhaps setting the player choice to false and leaving the ID blank or setting it to 0 will make the package the default one?

1 Like

There’s a property in StarterPlayer, Disable LoadCharacter Appearance.

This will make everyone look grey and blocky, if you want them to look different you can use StarterCharacter instead.

I see how this would be effective, however I’m ideally just looking to remove any existing packages and nothing more?

Here’s one way to remove bundles using the HumanoidDescription system released not too long ago. It uses some code from the “Change an Existing Character’s Assets” tutorial in the page I linked.

-- Given a player's character, remove its bundles.
-- The HumanoidDescription system can be pretty temperamental at times, so wrap this in a pcall.
local function removeBundles(character)
	local humanoid = character:FindFirstChildOfClass("Humanoid")
	if not humanoid then
		error("Character has no humanoid.")
	end
	
	local descriptionClone = humanoid:GetAppliedDescription()
	descriptionClone.Head = 0
	descriptionClone.LeftArm = 0
	descriptionClone.RightArm = 0
	descriptionClone.LeftLeg = 0
	descriptionClone.RightLeg = 0
	descriptionClone.Torso = 0
	humanoid:ApplyDescription(descriptionClone)
end

Now just call this on a player’s character whenever they spawn and you’re all set :slight_smile:

25 Likes

This is probably worth a bug report, but studio gets mad when you set it to 0, even though 0 should mean “use the default blocky characters”…

image

10 Likes

It’s too bad you can’t do this without re-spawning them. I was trying to figure out how to do this without re-spawning a player. However, the player just ends up dying right away. (Was attempting to run this in an AvatarEditor)

Not at my desk right now and there has been a solution, but couldn’t you just take your blocky characters, get the MeshID for each of them, then for every body part, if head.Mesh.MeshId ~= originalMesh then hesd.Mesh.MeshId == mesh? At the hospitsl so cannot confirm nor deny, bit I feel as this is a half decent method…?

No. You will need to set those to a random number so it can apply the blocky plr mesh.

1 Like

Ideally you shouldn’t be just using “random numbers” and use a proper solution. In this case, the Game Settings window does not accept 0 as a valid id for any of the body parts, so you can apply a HumanoidDescription with zeroed values (as the solution post does) to depackage characters.

1 Like

You can probably call it whenever the player joins on the server.

Something like this would do, I think.

game.Players.PlayerAdded:Connect(function(player)
    player.CharacterAdded:Connect(function(character)
        removeBundles(character)
    end)
end)