@rbxts/falldown 1.1.6 → 1.1.8
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 +2 -2
- package/out/init.luau +21 -108
- package/package.json +1 -1
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
|
|
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,
|
|
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,
|
|
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
|
|
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
|
|
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
|
|
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,16 @@ do
|
|
|
866
858
|
end
|
|
867
859
|
function Falldown:constructor()
|
|
868
860
|
end
|
|
869
|
-
function Falldown:
|
|
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
864
|
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
|
|
906
865
|
originalPart.CollisionGroup = bodypartGroupId
|
|
907
|
-
|
|
866
|
+
if partName ~= "HumanoidRootPart" then
|
|
867
|
+
originalPart:SetAttribute("Falldown_Reverse_CC_To", originalPart.CanCollide)
|
|
868
|
+
originalPart.CanCollide = true
|
|
869
|
+
end
|
|
908
870
|
end
|
|
909
|
-
return proxyMap
|
|
910
871
|
end
|
|
911
872
|
function Falldown:CreateActiveRagdollR6(character, humanoid, standFadeTime, automaticDuration, exitMode, getupFront, getupBack)
|
|
912
873
|
local leftArm = character:FindFirstChild("Left Arm")
|
|
@@ -940,19 +901,15 @@ do
|
|
|
940
901
|
BodyPartMapping.Head = head
|
|
941
902
|
BodyPartMapping.HumanoidRootPart = humanoidRootPart
|
|
942
903
|
local owner = Players:GetPlayerFromCharacter(character)
|
|
943
|
-
local proxyGroupId = HttpService:GenerateGUID(false)
|
|
944
904
|
local bodypartGroupId = HttpService:GenerateGUID(false)
|
|
945
905
|
for _1, descendant in character:GetDescendants() do
|
|
946
|
-
if descendant:IsA("BasePart") then
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
end)
|
|
951
|
-
end
|
|
952
|
-
descendant.CollisionGroup = bodypartGroupId
|
|
906
|
+
if descendant:IsA("BasePart") and not descendant.Anchored then
|
|
907
|
+
pcall(function()
|
|
908
|
+
descendant:SetNetworkOwner(owner)
|
|
909
|
+
end)
|
|
953
910
|
end
|
|
954
911
|
end
|
|
955
|
-
|
|
912
|
+
self:SetupCollisionGroup(BodyPartMapping, bodypartGroupId)
|
|
956
913
|
humanoid:SetStateEnabled(Enum.HumanoidStateType.Jumping, false)
|
|
957
914
|
humanoid:SetStateEnabled(Enum.HumanoidStateType.GettingUp, false)
|
|
958
915
|
humanoid.PlatformStand = true
|
|
@@ -1091,14 +1048,6 @@ do
|
|
|
1091
1048
|
joint.UpperAngle = info.Info.UpperAngle
|
|
1092
1049
|
joint.TwistUpperAngle = info.Info.TwistUpperAngle
|
|
1093
1050
|
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
1051
|
replacing.Enabled = false
|
|
1103
1052
|
local _arg0 = {
|
|
1104
1053
|
Attachment0 = at0,
|
|
@@ -1121,14 +1070,6 @@ do
|
|
|
1121
1070
|
weld.Parent = part0
|
|
1122
1071
|
weld.Part0 = part0
|
|
1123
1072
|
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
1073
|
replacing.Enabled = false
|
|
1133
1074
|
local _arg0 = {
|
|
1134
1075
|
Attachment0 = nil,
|
|
@@ -1151,7 +1092,7 @@ do
|
|
|
1151
1092
|
end
|
|
1152
1093
|
end
|
|
1153
1094
|
humanoid.EvaluateStateMachine = false
|
|
1154
|
-
return ActiveRagdoll.new(character, height, standFadeTime, humanoid, humanoidRootPart, leftLeg, rightLeg, destructionInfo,
|
|
1095
|
+
return ActiveRagdoll.new(character, height, standFadeTime, humanoid, humanoidRootPart, leftLeg, rightLeg, destructionInfo, bodypartGroupId, automaticDuration, exitMode, getupFrontTrack, getupBackTrack)
|
|
1155
1096
|
end
|
|
1156
1097
|
function Falldown:CreateActiveRagdollR15(character, humanoid, standFadeTime, automaticDuration, exitMode, getupFront, getupBack)
|
|
1157
1098
|
local leftUpperArm = character:FindFirstChild("LeftUpperArm")
|
|
@@ -1203,19 +1144,15 @@ do
|
|
|
1203
1144
|
BodyPartMapping.Head = head
|
|
1204
1145
|
BodyPartMapping.HumanoidRootPart = humanoidRootPart
|
|
1205
1146
|
local owner = Players:GetPlayerFromCharacter(character)
|
|
1206
|
-
local proxyGroupId = HttpService:GenerateGUID(false)
|
|
1207
1147
|
local bodypartGroupId = HttpService:GenerateGUID(false)
|
|
1208
1148
|
for _1, descendant in character:GetDescendants() do
|
|
1209
|
-
if descendant:IsA("BasePart") then
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
end)
|
|
1214
|
-
end
|
|
1215
|
-
descendant.CollisionGroup = bodypartGroupId
|
|
1149
|
+
if descendant:IsA("BasePart") and not descendant.Anchored then
|
|
1150
|
+
pcall(function()
|
|
1151
|
+
descendant:SetNetworkOwner(owner)
|
|
1152
|
+
end)
|
|
1216
1153
|
end
|
|
1217
1154
|
end
|
|
1218
|
-
|
|
1155
|
+
self:SetupCollisionGroup(BodyPartMapping, bodypartGroupId)
|
|
1219
1156
|
humanoid:SetStateEnabled(Enum.HumanoidStateType.Jumping, false)
|
|
1220
1157
|
humanoid:SetStateEnabled(Enum.HumanoidStateType.GettingUp, false)
|
|
1221
1158
|
humanoid.PlatformStand = true
|
|
@@ -1508,14 +1445,6 @@ do
|
|
|
1508
1445
|
joint.UpperAngle = info.Info.UpperAngle
|
|
1509
1446
|
joint.TwistUpperAngle = info.Info.TwistUpperAngle
|
|
1510
1447
|
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
1448
|
replacing.Enabled = false
|
|
1520
1449
|
local _arg0 = {
|
|
1521
1450
|
Attachment0 = at0,
|
|
@@ -1550,14 +1479,6 @@ do
|
|
|
1550
1479
|
joint.LimitsEnabled = info.Info.LimitsEnabled
|
|
1551
1480
|
joint.UpperAngle = info.Info.UpperAngle
|
|
1552
1481
|
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
1482
|
replacing.Enabled = false
|
|
1562
1483
|
local _arg0 = {
|
|
1563
1484
|
Attachment0 = at0,
|
|
@@ -1580,14 +1501,6 @@ do
|
|
|
1580
1501
|
weld.Parent = part0
|
|
1581
1502
|
weld.Part0 = part0
|
|
1582
1503
|
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
1504
|
replacing.Enabled = false
|
|
1592
1505
|
local _arg0 = {
|
|
1593
1506
|
Attachment0 = nil,
|
|
@@ -1610,7 +1523,7 @@ do
|
|
|
1610
1523
|
end
|
|
1611
1524
|
end
|
|
1612
1525
|
humanoid.EvaluateStateMachine = false
|
|
1613
|
-
return ActiveRagdoll.new(character, height, standFadeTime, humanoid, humanoidRootPart, leftFoot, rightFoot, destructionInfo,
|
|
1526
|
+
return ActiveRagdoll.new(character, height, standFadeTime, humanoid, humanoidRootPart, leftFoot, rightFoot, destructionInfo, bodypartGroupId, automaticDuration, exitMode, getupFrontTrack, getupBackTrack)
|
|
1614
1527
|
end
|
|
1615
1528
|
function Falldown:RagdollCharacter(character, standupFadeTime, automaticDuration, exitMode, getupFront, getupBack)
|
|
1616
1529
|
local __activeRagdolls = self._activeRagdolls
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rbxts/falldown",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.8",
|
|
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": {
|