Is there any way to stop a character from falling apart using code? Etc weld or something?
Here’s what it looks like:
Set Humanoid.BreakJointsOnDeath
to false
to prevent the Motor6D
welds from being Removed from the character.
If you are looking to make a Ragdoll on Death type of system, iterate through the entire character, remove the Motor6D
welds and Replace them with a BallSocketConstraint
What if Motor6D welds were never set. The picture I showed is just from a default rig in workspace breaking when the game is run.
You can use for loops to weld everything to the HumanoidRootPart
Example
for _,Limb in pairs(Dummy:GetChildren()) do
if Limb and Limb:IsA("BasePart") then
local weld = Instance.new("WeldConstraint", Limb)
weld.Part0 = Limb
wled.Part1 = Dummy.HumanoidRootPart
end
end
If they were never set, you would have to iterate over the character, and apply the Part0
and Part1
values manually to the Corresponding BasePart
, which would be Tedious to do.
What do you mean by the part0 and part1 values. Could you provide an example?
Hey! Saw your code. Haven’t tested it yet(will test tomorrow), but was wondering what @DasKairo means when they refer to Motor6D Part0 and Part1?
Frist part to attach (Part0)
Second part to attach (Part1)
Motor6D works like a weld, you have P1 representing the first part and P0 representing the part you want to weld to. Then There is C0 and C1 representing their corresponding CFames
This should provide all the info you need:
Motor6D documentation