@rbxts/falldown 1.1.4 → 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.
Files changed (2) hide show
  1. package/out/init.luau +34 -2
  2. 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: snap character to standing pose, no clone or animation ──
615
- self.Character:PivotTo(targetCFrame)
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
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rbxts/falldown",
3
- "version": "1.1.4",
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": {