@rbxts/falldown 1.1.3 → 1.1.5
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/init.luau +49 -7
- package/package.json +1 -1
package/out/init.luau
CHANGED
|
@@ -611,8 +611,40 @@ do
|
|
|
611
611
|
local forwardOnSurface = right:Cross(groundNormal).Unit
|
|
612
612
|
local targetCFrame = CFrame.fromMatrix(centerPoint, forwardOnSurface, groundNormal)
|
|
613
613
|
if exitMode == Falldown.ExitMode.Immediate then
|
|
614
|
-
-- ── Immediate:
|
|
615
|
-
self.Character:
|
|
614
|
+
-- ── Immediate: raycast down from torso center, stand upright to world ──
|
|
615
|
+
local torso = self.Character:FindFirstChild("UpperTorso") or self.Character:FindFirstChild("Torso") or self.HumanoidRootPart
|
|
616
|
+
local torsoPos = torso.Position
|
|
617
|
+
local immCastParams = RaycastParams.new()
|
|
618
|
+
immCastParams.FilterDescendantsInstances = { self.Character }
|
|
619
|
+
immCastParams.FilterType = Enum.RaycastFilterType.Exclude
|
|
620
|
+
immCastParams.IgnoreWater = true
|
|
621
|
+
local immCast = Workspace:Raycast(torsoPos, Vector3.new(0, -50, 0), immCastParams)
|
|
622
|
+
local _result_2 = immCast
|
|
623
|
+
if _result_2 ~= nil then
|
|
624
|
+
_result_2 = _result_2.Position
|
|
625
|
+
end
|
|
626
|
+
local _condition_2 = _result_2
|
|
627
|
+
if not _condition_2 then
|
|
628
|
+
_condition_2 = torsoPos
|
|
629
|
+
end
|
|
630
|
+
local immGroundPoint = _condition_2
|
|
631
|
+
local _vector3_1 = Vector3.new(0, self._objectiveHeight, 0)
|
|
632
|
+
local immCenter = immGroundPoint + _vector3_1
|
|
633
|
+
-- Face along the flattened feet-to-head direction (XZ plane)
|
|
634
|
+
local head = self.Character:FindFirstChild("Head")
|
|
635
|
+
local feetMid = self.LeftTouchPart.Position:Lerp(self.RightTouchPart.Position, 0.5)
|
|
636
|
+
local headPos = if (head and head:IsA("BasePart")) then head.Position else self.HumanoidRootPart.Position
|
|
637
|
+
local immFacing = Vector3.new(headPos.X - feetMid.X, 0, headPos.Z - feetMid.Z)
|
|
638
|
+
if immFacing.Magnitude < 1e-3 then
|
|
639
|
+
immFacing = Vector3.new(self.HumanoidRootPart.CFrame.LookVector.X, 0, self.HumanoidRootPart.CFrame.LookVector.Z)
|
|
640
|
+
end
|
|
641
|
+
if immFacing.Magnitude < 1e-3 then
|
|
642
|
+
immFacing = Vector3.new(0, 0, 1)
|
|
643
|
+
end
|
|
644
|
+
immFacing = immFacing.Unit
|
|
645
|
+
local _immFacing = immFacing
|
|
646
|
+
local immTargetCFrame = CFrame.lookAt(immCenter, immCenter + _immFacing)
|
|
647
|
+
self.Character:PivotTo(immTargetCFrame)
|
|
616
648
|
for _, descendant in self.Character:GetDescendants() do
|
|
617
649
|
if descendant:IsA("BasePart") then
|
|
618
650
|
descendant.Anchored = false
|
|
@@ -637,7 +669,9 @@ do
|
|
|
637
669
|
if self.HumanoidRootPart.Anchored then
|
|
638
670
|
return nil
|
|
639
671
|
end
|
|
640
|
-
|
|
672
|
+
pcall(function()
|
|
673
|
+
self.HumanoidRootPart:SetNetworkOwner(self.Owner)
|
|
674
|
+
end)
|
|
641
675
|
end)
|
|
642
676
|
self.Ended:Fire()
|
|
643
677
|
self.Ended:Destroy()
|
|
@@ -789,7 +823,9 @@ do
|
|
|
789
823
|
if self.HumanoidRootPart.Anchored then
|
|
790
824
|
return nil
|
|
791
825
|
end
|
|
792
|
-
|
|
826
|
+
pcall(function()
|
|
827
|
+
self.HumanoidRootPart:SetNetworkOwner(self.Owner)
|
|
828
|
+
end)
|
|
793
829
|
end)
|
|
794
830
|
self.Humanoid.EvaluateStateMachine = true
|
|
795
831
|
self.Humanoid:SetStateEnabled(Enum.HumanoidStateType.Jumping, true)
|
|
@@ -859,7 +895,9 @@ do
|
|
|
859
895
|
weld.Parent = proxyPart
|
|
860
896
|
proxyPart.Parent = Workspace
|
|
861
897
|
if not proxyPart.Anchored then
|
|
862
|
-
|
|
898
|
+
pcall(function()
|
|
899
|
+
proxyPart:SetNetworkOwner(owner)
|
|
900
|
+
end)
|
|
863
901
|
end
|
|
864
902
|
proxyPart.CollisionGroup = proxyGroupId
|
|
865
903
|
originalPart.CollisionGroup = bodypartGroupId
|
|
@@ -904,7 +942,9 @@ do
|
|
|
904
942
|
for _1, descendant in character:GetDescendants() do
|
|
905
943
|
if descendant:IsA("BasePart") then
|
|
906
944
|
if not descendant.Anchored then
|
|
907
|
-
|
|
945
|
+
pcall(function()
|
|
946
|
+
descendant:SetNetworkOwner(owner)
|
|
947
|
+
end)
|
|
908
948
|
end
|
|
909
949
|
descendant.CollisionGroup = bodypartGroupId
|
|
910
950
|
end
|
|
@@ -1165,7 +1205,9 @@ do
|
|
|
1165
1205
|
for _1, descendant in character:GetDescendants() do
|
|
1166
1206
|
if descendant:IsA("BasePart") then
|
|
1167
1207
|
if not descendant.Anchored then
|
|
1168
|
-
|
|
1208
|
+
pcall(function()
|
|
1209
|
+
descendant:SetNetworkOwner(owner)
|
|
1210
|
+
end)
|
|
1169
1211
|
end
|
|
1170
1212
|
descendant.CollisionGroup = bodypartGroupId
|
|
1171
1213
|
end
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rbxts/falldown",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.5",
|
|
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": {
|