Startercharacter, when dying doesn't 'fall apart' properly

Hello devs, I’ve created this simple character (I don’t know modeling yet), to practice and learn about how to make a custom character, as well as the objects used to make it work.

image

However, I’m having a problem.

When the humanoid’s health of the character reaches 0, it doesn’t “fall apart” like a normal Roblox avatar would; instead, it either remains static in mid-air or doesn’t break apart completely. I tried using a script that loops through all the character’s parts, looking for joints (Motor6D) and destroying them, but it still doesn’t work.

Here is a video of the problem (Sorry for the quality, Idk what happened to the recorder).

Problem with the StarterCharacter

1 Like

check if the parts are anchored?

1 Like

i second this, try setting all BasePart descendants of the character model Unanchored when they die

but make it so when player dies unanchor all descendants of chatacter

If you’re using a custom humanoid confirm BreakJointsOnDeath is enabled

Yes, the character parts are unanchored.

I already tried it, but it still doesn’t work, it stays in the air

it looks on the video that the joints are being breaked so something must be anchored.

I’ve already checked, and it is enabled

Maybe some script anchors a part of the character when it dies
or something

Show the explorer view of your model / character

Edit: Saw the video. Your character isnt anchored, but when your character dies, the only forces acting on those parts on gravity, meanining they get pulled straight down. If you want to make them ‘fall apart’ you have to apply an outwards force on each part when the player dies.

An example of this would be something like

game.Players.PlayerAdded:Connect(function(player: Player)  
	player.CharacterAdded:Connect(function(character: Model) 
		character:WaitForChild("Humanoid").Died:Connect(function()
			for i, v in pairs(character:GetChildren()) do
				if v:IsA("BasePart") then
					local forceVector = (character:GetPivot().Position - v.Position).Unit * math.random(5,10)
					v:ApplyImpulse(forceVector)
				end
			end
		end)
	end)
end)
1 Like

are you only using motor6d? maybe it will only break with motor6d joints but you are using normal welds or weldconstraints too?

1 Like

Here is the structure of the model.

image

These weldconstraints are for connecting parts that contain decals (one for the face and another for the Roblox logo, referring to a t-shirt). I did this to create the effect from the Mario 64 model where it looks like the texture on his eyes and overalls buttons is slightly separated from the model.

I thought it might be due to the WeldConstraints, but I removed them and the same issue still occurs.

Yes, I use Motor6D and WeldConstraints, but only the WeldConstraints for parts other than the character

I included your code with the one I used to break the joints, and it works perfectly now, thanks man!

1 Like

Here’s the ‘perfect’ version of this (I think, – I did test it)

You can paste this into a regular server script parented to your StarterCharacter model and it will do the effect

local forceFactor = 25 -- effective but not overkill
local char = script.Parent
char:WaitForChild("Humanoid").Died:Connect(function()
	for i, obj:BasePart in(char:GetChildren()) do
		if obj:IsA("BasePart") then
			local forceVector = (obj.Position - char:GetPivot().Position).Unit * obj:GetMass() * forceFactor
			obj:ApplyImpulse(forceVector)
			print('impulsed '..obj.Name)
		end
	end
end)

This was interesting ‘bug’ given that your characters physics are under client replication until death, meaning once you die you can then apply the ‘Break apart’ effect on the server, but doing so on the client will cause the parts to stutter and return to their original place.

1 Like

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