@rbxts/falldown 1.1.6 → 1.1.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/out/index.d.ts CHANGED
@@ -78,11 +78,11 @@ export declare class Falldown {
78
78
  readonly Immediate: 1;
79
79
  };
80
80
  private static readonly _activeRagdolls;
81
- private static MakeProxies;
81
+ private static SetupCollisionGroup;
82
82
  private static CreateActiveRagdollR6;
83
83
  private static CreateActiveRagdollR15;
84
84
  /**
85
- * Converts a character into a ragdoll with physics-based movement. Detects R6/R15 rig automatically, replaces Motor6Ds with constraints, creates collision proxies, and sets up automatic recovery.
85
+ * Converts a character into a ragdoll with physics-based movement. Detects R6/R15 rig automatically, replaces Motor6Ds with constraints, manages collision groups, and sets up automatic recovery.
86
86
  * @static
87
87
  * @param character - The character `Model` to ragdoll. Must have a Humanoid.
88
88
  * @param standupFadeTime - Duration (in seconds) for the fade clone to remain visible after standing up. Recommended: 0.3-0.7 seconds.
package/out/init.luau CHANGED
@@ -374,7 +374,7 @@ do
374
374
  local self = setmetatable({}, ActiveRagdoll)
375
375
  return self:constructor(...) or self
376
376
  end
377
- function ActiveRagdoll:constructor(character, objectiveHeight, standFadeTime, humanoid, humanoidRootPart, leftTouchObj, rightTouchObj, jointDestructionInfo, proxyGroupId, bodypartGroupId, proxyMapping, automaticDuration, exitMode, getupFront, getupBack)
377
+ function ActiveRagdoll:constructor(character, objectiveHeight, standFadeTime, humanoid, humanoidRootPart, leftTouchObj, rightTouchObj, jointDestructionInfo, bodypartGroupId, automaticDuration, exitMode, getupFront, getupBack)
378
378
  self.Destroyed = Signal.new()
379
379
  self.Ended = Signal.new()
380
380
  character.Destroying:Once(function()
@@ -406,9 +406,7 @@ do
406
406
  end
407
407
  self._automaticDuration = automaticDuration
408
408
  self._jointDestructionInfo = jointDestructionInfo
409
- self._proxyGroupId = proxyGroupId
410
409
  self._bodypartGroupId = bodypartGroupId
411
- self._proxyMapping = proxyMapping
412
410
  self._objectiveHeight = objectiveHeight
413
411
  self._standFadeTime = standFadeTime
414
412
  local _condition = self._automaticDuration
@@ -440,7 +438,7 @@ do
440
438
  if self.Character.Parent == nil then
441
439
  return nil
442
440
  end
443
- if #self._jointDestructionInfo == 0 or next(self._proxyMapping) == nil then
441
+ if #self._jointDestructionInfo == 0 then
444
442
  return nil
445
443
  end
446
444
  local velocityDirection = velocity.Unit
@@ -487,7 +485,7 @@ do
487
485
  if self.Character.Parent == nil then
488
486
  return nil
489
487
  end
490
- if #self._jointDestructionInfo == 0 or next(self._proxyMapping) == nil then
488
+ if #self._jointDestructionInfo == 0 then
491
489
  return nil
492
490
  end
493
491
  for _, descendant in self.Character:GetDescendants() do
@@ -504,7 +502,7 @@ do
504
502
  if self.CharacterDead and not overrideDeathLock then
505
503
  return nil
506
504
  end
507
- if #self._jointDestructionInfo == 0 or next(self._proxyMapping) == nil then
505
+ if #self._jointDestructionInfo == 0 then
508
506
  return nil
509
507
  end
510
508
  -- ── Shared: remove ragdoll constraints, restore Motor6Ds ──
@@ -531,11 +529,6 @@ do
531
529
  descendant.AssemblyAngularVelocity = Vector3.zero
532
530
  end
533
531
  end
534
- -- ── Shared: destroy proxy parts ──
535
- for _, proxyPart in self._proxyMapping do
536
- proxyPart:Destroy()
537
- end
538
- table.clear(self._proxyMapping)
539
532
  -- ── Shared: raycast for ground & compute stand CFrame ──
540
533
  local _cFrame = self.LeftTouchPart.CFrame
541
534
  local _cFrame_1 = CFrame.new(0, -(self.LeftTouchPart.Size.Y / 2), 0)
@@ -839,7 +832,6 @@ do
839
832
  clonedCharacter:Destroy()
840
833
  end)
841
834
  end
842
- PhysicsService:UnregisterCollisionGroup(self._proxyGroupId)
843
835
  PhysicsService:UnregisterCollisionGroup(self._bodypartGroupId)
844
836
  self.Destroyed:Fire()
845
837
  self.Destroyed:Destroy()
@@ -866,47 +858,12 @@ do
866
858
  end
867
859
  function Falldown:constructor()
868
860
  end
869
- function Falldown:MakeProxies(bodyPartMap, proxyGroupId, bodypartGroupId, owner)
870
- PhysicsService:RegisterCollisionGroup(proxyGroupId)
861
+ function Falldown:SetupCollisionGroup(bodyPartMap, bodypartGroupId)
871
862
  PhysicsService:RegisterCollisionGroup(bodypartGroupId)
872
- PhysicsService:CollisionGroupSetCollidable(proxyGroupId, bodypartGroupId, false)
873
- PhysicsService:CollisionGroupSetCollidable(proxyGroupId, "Default", true)
874
- PhysicsService:CollisionGroupSetCollidable(bodypartGroupId, "Default", false)
875
863
  PhysicsService:CollisionGroupSetCollidable(bodypartGroupId, bodypartGroupId, false)
876
- local proxyMap = {}
877
- for partName, originalPart in bodyPartMap do
878
- local proxyPart = Instance.new("Part")
879
- proxyPart.Name = partName .. "_Colprox"
880
- proxyPart.Size = originalPart.Size
881
- proxyPart.Transparency = 1
882
- proxyPart.CastShadow = false
883
- proxyPart.CanCollide = true
884
- proxyPart.CanQuery = false
885
- proxyPart.CanTouch = false
886
- proxyPart.Anchored = false
887
- proxyPart.Massless = false
888
- proxyPart.CFrame = originalPart.CFrame
889
- proxyPart.CustomPhysicalProperties = PhysicalProperties.new(1, 2, 0, 1, 1)
890
- if partName == "HumanoidRootPart" then
891
- proxyPart.CanCollide = false
892
- end
893
- local weld = Instance.new("Weld")
894
- weld.Name = partName .. "_Colprox_Weld"
895
- weld.Part0 = originalPart
896
- weld.Part1 = proxyPart
897
- weld.C0 = CFrame.identity
898
- weld.Parent = proxyPart
899
- proxyPart.Parent = Workspace
900
- if not proxyPart.Anchored then
901
- pcall(function()
902
- proxyPart:SetNetworkOwner(owner)
903
- end)
904
- end
905
- proxyPart.CollisionGroup = proxyGroupId
864
+ for _, originalPart in bodyPartMap do
906
865
  originalPart.CollisionGroup = bodypartGroupId
907
- proxyMap[partName] = proxyPart
908
866
  end
909
- return proxyMap
910
867
  end
911
868
  function Falldown:CreateActiveRagdollR6(character, humanoid, standFadeTime, automaticDuration, exitMode, getupFront, getupBack)
912
869
  local leftArm = character:FindFirstChild("Left Arm")
@@ -940,19 +897,15 @@ do
940
897
  BodyPartMapping.Head = head
941
898
  BodyPartMapping.HumanoidRootPart = humanoidRootPart
942
899
  local owner = Players:GetPlayerFromCharacter(character)
943
- local proxyGroupId = HttpService:GenerateGUID(false)
944
900
  local bodypartGroupId = HttpService:GenerateGUID(false)
945
901
  for _1, descendant in character:GetDescendants() do
946
- if descendant:IsA("BasePart") then
947
- if not descendant.Anchored then
948
- pcall(function()
949
- descendant:SetNetworkOwner(owner)
950
- end)
951
- end
952
- descendant.CollisionGroup = bodypartGroupId
902
+ if descendant:IsA("BasePart") and not descendant.Anchored then
903
+ pcall(function()
904
+ descendant:SetNetworkOwner(owner)
905
+ end)
953
906
  end
954
907
  end
955
- local ProxyMapping = self:MakeProxies(BodyPartMapping, proxyGroupId, bodypartGroupId, owner)
908
+ self:SetupCollisionGroup(BodyPartMapping, bodypartGroupId)
956
909
  humanoid:SetStateEnabled(Enum.HumanoidStateType.Jumping, false)
957
910
  humanoid:SetStateEnabled(Enum.HumanoidStateType.GettingUp, false)
958
911
  humanoid.PlatformStand = true
@@ -1091,14 +1044,6 @@ do
1091
1044
  joint.UpperAngle = info.Info.UpperAngle
1092
1045
  joint.TwistUpperAngle = info.Info.TwistUpperAngle
1093
1046
  joint.TwistLowerAngle = info.Info.TwistLowerAngle
1094
- local proxyNoCol0 = Instance.new("NoCollisionConstraint")
1095
- proxyNoCol0.Name = constraintName .. "_NoColProxyOnly"
1096
- local _name = part0.Name
1097
- proxyNoCol0.Parent = ProxyMapping[_name]
1098
- local _name_1 = part0.Name
1099
- proxyNoCol0.Part0 = ProxyMapping[_name_1]
1100
- local _name_2 = part1.Name
1101
- proxyNoCol0.Part1 = ProxyMapping[_name_2]
1102
1047
  replacing.Enabled = false
1103
1048
  local _arg0 = {
1104
1049
  Attachment0 = at0,
@@ -1121,14 +1066,6 @@ do
1121
1066
  weld.Parent = part0
1122
1067
  weld.Part0 = part0
1123
1068
  weld.Part1 = part1
1124
- local proxyNoCol0 = Instance.new("NoCollisionConstraint")
1125
- proxyNoCol0.Name = constraintName .. "_NoColProxyOnly"
1126
- local _name = part0.Name
1127
- proxyNoCol0.Parent = ProxyMapping[_name]
1128
- local _name_1 = part0.Name
1129
- proxyNoCol0.Part0 = ProxyMapping[_name_1]
1130
- local _name_2 = part1.Name
1131
- proxyNoCol0.Part1 = ProxyMapping[_name_2]
1132
1069
  replacing.Enabled = false
1133
1070
  local _arg0 = {
1134
1071
  Attachment0 = nil,
@@ -1151,7 +1088,7 @@ do
1151
1088
  end
1152
1089
  end
1153
1090
  humanoid.EvaluateStateMachine = false
1154
- return ActiveRagdoll.new(character, height, standFadeTime, humanoid, humanoidRootPart, leftLeg, rightLeg, destructionInfo, proxyGroupId, bodypartGroupId, ProxyMapping, automaticDuration, exitMode, getupFrontTrack, getupBackTrack)
1091
+ return ActiveRagdoll.new(character, height, standFadeTime, humanoid, humanoidRootPart, leftLeg, rightLeg, destructionInfo, bodypartGroupId, automaticDuration, exitMode, getupFrontTrack, getupBackTrack)
1155
1092
  end
1156
1093
  function Falldown:CreateActiveRagdollR15(character, humanoid, standFadeTime, automaticDuration, exitMode, getupFront, getupBack)
1157
1094
  local leftUpperArm = character:FindFirstChild("LeftUpperArm")
@@ -1203,19 +1140,15 @@ do
1203
1140
  BodyPartMapping.Head = head
1204
1141
  BodyPartMapping.HumanoidRootPart = humanoidRootPart
1205
1142
  local owner = Players:GetPlayerFromCharacter(character)
1206
- local proxyGroupId = HttpService:GenerateGUID(false)
1207
1143
  local bodypartGroupId = HttpService:GenerateGUID(false)
1208
1144
  for _1, descendant in character:GetDescendants() do
1209
- if descendant:IsA("BasePart") then
1210
- if not descendant.Anchored then
1211
- pcall(function()
1212
- descendant:SetNetworkOwner(owner)
1213
- end)
1214
- end
1215
- descendant.CollisionGroup = bodypartGroupId
1145
+ if descendant:IsA("BasePart") and not descendant.Anchored then
1146
+ pcall(function()
1147
+ descendant:SetNetworkOwner(owner)
1148
+ end)
1216
1149
  end
1217
1150
  end
1218
- local ProxyMapping = self:MakeProxies(BodyPartMapping, proxyGroupId, bodypartGroupId, owner)
1151
+ self:SetupCollisionGroup(BodyPartMapping, bodypartGroupId)
1219
1152
  humanoid:SetStateEnabled(Enum.HumanoidStateType.Jumping, false)
1220
1153
  humanoid:SetStateEnabled(Enum.HumanoidStateType.GettingUp, false)
1221
1154
  humanoid.PlatformStand = true
@@ -1508,14 +1441,6 @@ do
1508
1441
  joint.UpperAngle = info.Info.UpperAngle
1509
1442
  joint.TwistUpperAngle = info.Info.TwistUpperAngle
1510
1443
  joint.TwistLowerAngle = info.Info.TwistLowerAngle
1511
- local proxyNoCol0 = Instance.new("NoCollisionConstraint")
1512
- proxyNoCol0.Name = constraintName .. "_NoColProxyOnly"
1513
- local _name = part0.Name
1514
- proxyNoCol0.Parent = ProxyMapping[_name]
1515
- local _name_1 = part0.Name
1516
- proxyNoCol0.Part0 = ProxyMapping[_name_1]
1517
- local _name_2 = part1.Name
1518
- proxyNoCol0.Part1 = ProxyMapping[_name_2]
1519
1444
  replacing.Enabled = false
1520
1445
  local _arg0 = {
1521
1446
  Attachment0 = at0,
@@ -1550,14 +1475,6 @@ do
1550
1475
  joint.LimitsEnabled = info.Info.LimitsEnabled
1551
1476
  joint.UpperAngle = info.Info.UpperAngle
1552
1477
  joint.LowerAngle = info.Info.LowerAngle
1553
- local proxyNoCol0 = Instance.new("NoCollisionConstraint")
1554
- proxyNoCol0.Name = constraintName .. "_NoColProxyOnly"
1555
- local _name = part0.Name
1556
- proxyNoCol0.Parent = ProxyMapping[_name]
1557
- local _name_1 = part0.Name
1558
- proxyNoCol0.Part0 = ProxyMapping[_name_1]
1559
- local _name_2 = part1.Name
1560
- proxyNoCol0.Part1 = ProxyMapping[_name_2]
1561
1478
  replacing.Enabled = false
1562
1479
  local _arg0 = {
1563
1480
  Attachment0 = at0,
@@ -1580,14 +1497,6 @@ do
1580
1497
  weld.Parent = part0
1581
1498
  weld.Part0 = part0
1582
1499
  weld.Part1 = part1
1583
- local proxyNoCol0 = Instance.new("NoCollisionConstraint")
1584
- proxyNoCol0.Name = constraintName .. "_NoColProxyOnly"
1585
- local _name = part0.Name
1586
- proxyNoCol0.Parent = ProxyMapping[_name]
1587
- local _name_1 = part0.Name
1588
- proxyNoCol0.Part0 = ProxyMapping[_name_1]
1589
- local _name_2 = part1.Name
1590
- proxyNoCol0.Part1 = ProxyMapping[_name_2]
1591
1500
  replacing.Enabled = false
1592
1501
  local _arg0 = {
1593
1502
  Attachment0 = nil,
@@ -1610,7 +1519,7 @@ do
1610
1519
  end
1611
1520
  end
1612
1521
  humanoid.EvaluateStateMachine = false
1613
- return ActiveRagdoll.new(character, height, standFadeTime, humanoid, humanoidRootPart, leftFoot, rightFoot, destructionInfo, proxyGroupId, bodypartGroupId, ProxyMapping, automaticDuration, exitMode, getupFrontTrack, getupBackTrack)
1522
+ return ActiveRagdoll.new(character, height, standFadeTime, humanoid, humanoidRootPart, leftFoot, rightFoot, destructionInfo, bodypartGroupId, automaticDuration, exitMode, getupFrontTrack, getupBackTrack)
1614
1523
  end
1615
1524
  function Falldown:RagdollCharacter(character, standupFadeTime, automaticDuration, exitMode, getupFront, getupBack)
1616
1525
  local __activeRagdolls = self._activeRagdolls
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rbxts/falldown",
3
- "version": "1.1.6",
3
+ "version": "1.1.7",
4
4
  "description": "A realistic ragdoll physics system for Roblox with smooth getup animations, collision management, and customizable velocity modes. Supports both R6 and R15 rigs with surface-aware positioning.",
5
5
  "main": "out/init.luau",
6
6
  "scripts": {