@rbxts/falldown 1.1.0 → 1.1.2

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 +12 -9
  2. package/package.json +1 -1
package/out/init.luau CHANGED
@@ -575,6 +575,7 @@ do
575
575
  local gDot = gravity:Dot(groundNormal)
576
576
  local _arg0_1 = groundNormal * gDot
577
577
  local downhill = gravity - _arg0_1
578
+ local isSloped = downhill.Magnitude >= 0.05
578
579
  if downhill.Magnitude < 1e-3 then
579
580
  downhill = Vector3.new(0, 0, 1)
580
581
  end
@@ -594,7 +595,7 @@ do
594
595
  if along.Magnitude < 1e-3 then
595
596
  along = downhill
596
597
  end
597
- if along:Dot(downhill) < 0 then
598
+ if isSloped and along:Dot(downhill) < 0 then
598
599
  along = along * (-1)
599
600
  end
600
601
  return along.Unit
@@ -820,7 +821,7 @@ do
820
821
  end
821
822
  function Falldown:constructor()
822
823
  end
823
- function Falldown:MakeProxies(bodyPartMap, proxyGroupId, bodypartGroupId)
824
+ function Falldown:MakeProxies(bodyPartMap, proxyGroupId, bodypartGroupId, owner)
824
825
  PhysicsService:RegisterCollisionGroup(proxyGroupId)
825
826
  PhysicsService:RegisterCollisionGroup(bodypartGroupId)
826
827
  PhysicsService:CollisionGroupSetCollidable(proxyGroupId, bodypartGroupId, false)
@@ -851,7 +852,7 @@ do
851
852
  weld.C0 = CFrame.identity
852
853
  weld.Parent = proxyPart
853
854
  proxyPart.Parent = Workspace
854
- proxyPart:SetNetworkOwner(nil)
855
+ proxyPart:SetNetworkOwner(owner)
855
856
  proxyPart.CollisionGroup = proxyGroupId
856
857
  originalPart.CollisionGroup = bodypartGroupId
857
858
  proxyMap[partName] = proxyPart
@@ -876,7 +877,7 @@ do
876
877
  local _cFrame_2 = rightLeg.CFrame
877
878
  local _cFrame_3 = CFrame.new(0, -rightLeg.Size.Y / 2, 0)
878
879
  local endPos = _:Lerp((_cFrame_2 * _cFrame_3).Position, 0.5)
879
- local height = (primaryPos - endPos).Magnitude
880
+ local height = math.abs(primaryPos.Y - endPos.Y)
880
881
  humanoid:ChangeState(Enum.HumanoidStateType.Physics)
881
882
  local animator = humanoid:FindFirstChildOfClass("Animator") or Instance.new("Animator", humanoid)
882
883
  local getupFrontTrack = if getupFront then animator:LoadAnimation(getupFront) else nil
@@ -889,15 +890,16 @@ do
889
890
  BodyPartMapping.Torso = torso
890
891
  BodyPartMapping.Head = head
891
892
  BodyPartMapping.HumanoidRootPart = humanoidRootPart
893
+ local owner = Players:GetPlayerFromCharacter(character)
892
894
  local proxyGroupId = HttpService:GenerateGUID(false)
893
895
  local bodypartGroupId = HttpService:GenerateGUID(false)
894
896
  for _1, descendant in character:GetDescendants() do
895
897
  if descendant:IsA("BasePart") then
896
- descendant:SetNetworkOwner(nil)
898
+ descendant:SetNetworkOwner(owner)
897
899
  descendant.CollisionGroup = bodypartGroupId
898
900
  end
899
901
  end
900
- local ProxyMapping = self:MakeProxies(BodyPartMapping, proxyGroupId, bodypartGroupId)
902
+ local ProxyMapping = self:MakeProxies(BodyPartMapping, proxyGroupId, bodypartGroupId, owner)
901
903
  humanoid:SetStateEnabled(Enum.HumanoidStateType.Jumping, false)
902
904
  humanoid:SetStateEnabled(Enum.HumanoidStateType.GettingUp, false)
903
905
  humanoid.PlatformStand = true
@@ -1125,7 +1127,7 @@ do
1125
1127
  local _cFrame_2 = rightFoot.CFrame
1126
1128
  local _cFrame_3 = CFrame.new(0, -rightFoot.Size.Y / 2, 0)
1127
1129
  local endPos = _:Lerp((_cFrame_2 * _cFrame_3).Position, 0.5)
1128
- local height = (primaryPos - endPos).Magnitude
1130
+ local height = math.abs(primaryPos.Y - endPos.Y)
1129
1131
  humanoid:ChangeState(Enum.HumanoidStateType.Physics)
1130
1132
  local animator = humanoid:FindFirstChildOfClass("Animator") or Instance.new("Animator", humanoid)
1131
1133
  local getupFrontTrack = if getupFront then animator:LoadAnimation(getupFront) else nil
@@ -1147,15 +1149,16 @@ do
1147
1149
  BodyPartMapping.UpperTorso = upperTorso
1148
1150
  BodyPartMapping.Head = head
1149
1151
  BodyPartMapping.HumanoidRootPart = humanoidRootPart
1152
+ local owner = Players:GetPlayerFromCharacter(character)
1150
1153
  local proxyGroupId = HttpService:GenerateGUID(false)
1151
1154
  local bodypartGroupId = HttpService:GenerateGUID(false)
1152
1155
  for _1, descendant in character:GetDescendants() do
1153
1156
  if descendant:IsA("BasePart") then
1154
- descendant:SetNetworkOwner(nil)
1157
+ descendant:SetNetworkOwner(owner)
1155
1158
  descendant.CollisionGroup = bodypartGroupId
1156
1159
  end
1157
1160
  end
1158
- local ProxyMapping = self:MakeProxies(BodyPartMapping, proxyGroupId, bodypartGroupId)
1161
+ local ProxyMapping = self:MakeProxies(BodyPartMapping, proxyGroupId, bodypartGroupId, owner)
1159
1162
  humanoid:SetStateEnabled(Enum.HumanoidStateType.Jumping, false)
1160
1163
  humanoid:SetStateEnabled(Enum.HumanoidStateType.GettingUp, false)
1161
1164
  humanoid.PlatformStand = true
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rbxts/falldown",
3
- "version": "1.1.0",
3
+ "version": "1.1.2",
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": {