@quenty/ragdoll 15.24.0-canary.559.b31717d.0 → 15.24.0

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 (30) hide show
  1. package/CHANGELOG.md +1 -1
  2. package/package.json +32 -32
  3. package/src/Client/Classes/RagdollCameraShakeClient.lua +72 -64
  4. package/src/Client/Classes/RagdollClient.lua +1 -2
  5. package/src/Client/Classes/RagdollHumanoidOnDeathClient.lua +2 -2
  6. package/src/Client/Classes/RagdollHumanoidOnFallClient.lua +1 -1
  7. package/src/Client/Classes/RagdollableClient.lua +5 -5
  8. package/src/Client/RagdollBindersClient.lua +5 -5
  9. package/src/Client/RagdollServiceClient.lua +1 -1
  10. package/src/Server/Classes/Ragdoll.lua +1 -1
  11. package/src/Server/Classes/RagdollCameraShake.lua +2 -3
  12. package/src/Server/Classes/RagdollHumanoidOnDeath.lua +2 -2
  13. package/src/Server/Classes/RagdollHumanoidOnFall.lua +1 -2
  14. package/src/Server/Classes/Ragdollable.lua +7 -7
  15. package/src/Server/Classes/UnragdollAutomatically.lua +37 -35
  16. package/src/Server/Classes/UnragdollAutomaticallyConstants.lua +3 -3
  17. package/src/Server/RagdollBindersServer.lua +6 -6
  18. package/src/Server/RagdollService.lua +1 -1
  19. package/src/Shared/Classes/BindableRagdollHumanoidOnFall.lua +3 -5
  20. package/src/Shared/Classes/RagdollHumanoidOnFallConstants.lua +2 -2
  21. package/src/Shared/Classes/RagdollableBase.lua +1 -1
  22. package/src/Shared/Interfaces/RagdollableInterface.lua +7 -8
  23. package/src/Shared/RagdollServiceConstants.lua +2 -2
  24. package/src/Shared/Rigging/RagdollAdditionalAttachmentUtils.lua +44 -22
  25. package/src/Shared/Rigging/RagdollBallSocketUtils.lua +163 -163
  26. package/src/Shared/Rigging/RagdollCollisionUtils.lua +60 -61
  27. package/src/Shared/Rigging/RagdollMotorData.lua +3 -3
  28. package/src/Shared/Rigging/RagdollMotorLimitData.lua +78 -78
  29. package/src/Shared/Rigging/RagdollMotorUtils.lua +2 -2
  30. package/src/Shared/Rigging/RxRagdollUtils.lua +3 -3
@@ -16,7 +16,7 @@ local require = require(script.Parent.loader).load(script)
16
16
  local BinderProvider = require("BinderProvider")
17
17
 
18
18
  return BinderProvider.new(script.Name, function(self, serviceBag)
19
- --[=[
19
+ --[=[
20
20
  Apply this [Binder] to a humanoid to ragdoll it. Humanoid must already have [Ragdollable] defined.
21
21
 
22
22
  ```lua
@@ -57,31 +57,31 @@ return BinderProvider.new(script.Name, function(self, serviceBag)
57
57
  ]=]
58
58
  self:Add(serviceBag:GetService(require("Ragdoll")))
59
59
 
60
- --[=[
60
+ --[=[
61
61
  Enables ragdolling on a humanoid.
62
62
  @prop Ragdollable PlayerHumanoidBinder<Ragdollable>
63
63
  @within RagdollBindersServer
64
64
  ]=]
65
65
  self:Add(serviceBag:GetService(require("Ragdollable")))
66
66
 
67
- --[=[
67
+ --[=[
68
68
  Automatically applies ragdoll upon humanoid death.
69
69
  @prop RagdollHumanoidOnDeath PlayerHumanoidBinder<RagdollHumanoidOnDeath>
70
70
  @within RagdollBindersServer
71
71
  ]=]
72
72
  self:Add(serviceBag:GetService(require("RagdollHumanoidOnDeath")))
73
73
 
74
- --[=[
74
+ --[=[
75
75
  Automatically applies ragdoll upon humanoid fall.
76
76
  @prop RagdollHumanoidOnFall PlayerHumanoidBinder<RagdollHumanoidOnFall>
77
77
  @within RagdollBindersServer
78
78
  ]=]
79
79
  self:Add(serviceBag:GetService(require("RagdollHumanoidOnFall")))
80
80
 
81
- --[=[
81
+ --[=[
82
82
  Automatically unragdolls the humanoid.
83
83
  @prop UnragdollAutomatically PlayerHumanoidBinder<UnragdollAutomatically>
84
84
  @within RagdollBindersServer
85
85
  ]=]
86
86
  self:Add(serviceBag:GetService(require("UnragdollAutomatically")))
87
- end)
87
+ end)
@@ -74,4 +74,4 @@ function RagdollService:SetUnragdollAutomatically(unragdollAutomatically)
74
74
  self._serviceBag:GetService(require("UnragdollAutomatically")):SetAutomaticTagging(unragdollAutomatically)
75
75
  end
76
76
 
77
- return RagdollService
77
+ return RagdollService
@@ -42,7 +42,7 @@ function BindableRagdollHumanoidOnFall.new(humanoid, ragdollBinder)
42
42
  end)
43
43
 
44
44
  task.spawn(function()
45
- task.wait(math.random()*FRAME_TIME) -- Apply jitter
45
+ task.wait(math.random() * FRAME_TIME) -- Apply jitter
46
46
  while alive do
47
47
  self:_updateVelocity()
48
48
  task.wait(FRAME_TIME)
@@ -152,12 +152,10 @@ function BindableRagdollHumanoidOnFall:_updateVelocity()
152
152
  end
153
153
 
154
154
  local currentState = self._obj:GetState()
155
- if currentState == Enum.HumanoidStateType.Physics
156
- or currentState == Enum.HumanoidStateType.Swimming then
155
+ if currentState == Enum.HumanoidStateType.Physics or currentState == Enum.HumanoidStateType.Swimming then
157
156
  return
158
157
  end
159
158
 
160
-
161
159
  if (os.clock() - self._lastRagDollTime) <= RAGDOLL_DEBOUNCE_TIME then
162
160
  return
163
161
  end
@@ -165,4 +163,4 @@ function BindableRagdollHumanoidOnFall:_updateVelocity()
165
163
  self:_ragdollFromFall()
166
164
  end
167
165
 
168
- return BindableRagdollHumanoidOnFall
166
+ return BindableRagdollHumanoidOnFall
@@ -8,5 +8,5 @@ local require = require(script.Parent.loader).load(script)
8
8
  local Table = require("Table")
9
9
 
10
10
  return Table.readonly({
11
- REMOTE_EVENT_NAME = "RagdollHumanoidOnFallRemoteEvent";
12
- })
11
+ REMOTE_EVENT_NAME = "RagdollHumanoidOnFallRemoteEvent",
12
+ })
@@ -5,8 +5,8 @@
5
5
  local require = require(script.Parent.loader).load(script)
6
6
 
7
7
  local BaseObject = require("BaseObject")
8
- local RxSignal = require("RxSignal")
9
8
  local Rx = require("Rx")
9
+ local RxSignal = require("RxSignal")
10
10
 
11
11
  local RagdollableBase = setmetatable({}, BaseObject)
12
12
  RagdollableBase.ClassName = "RagdollableBase"
@@ -1,4 +1,3 @@
1
-
2
1
  --[=[
3
2
  @class RagdollableInterface
4
3
  ]=]
@@ -8,11 +7,11 @@ local require = require(script.Parent.loader).load(script)
8
7
  local TieDefinition = require("TieDefinition")
9
8
 
10
9
  return TieDefinition.new("Ragdollable", {
11
- Ragdolled = TieDefinition.Types.SIGNAL;
12
- Unragdolled = TieDefinition.Types.SIGNAL;
10
+ Ragdolled = TieDefinition.Types.SIGNAL,
11
+ Unragdolled = TieDefinition.Types.SIGNAL,
13
12
 
14
- Ragdoll = TieDefinition.Types.METHOD;
15
- Unragdoll = TieDefinition.Types.METHOD;
16
- ObserveIsRagdolled = TieDefinition.Types.METHOD;
17
- IsRagdolled = TieDefinition.Types.METHOD;
18
- })
13
+ Ragdoll = TieDefinition.Types.METHOD,
14
+ Unragdoll = TieDefinition.Types.METHOD,
15
+ ObserveIsRagdolled = TieDefinition.Types.METHOD,
16
+ IsRagdolled = TieDefinition.Types.METHOD,
17
+ })
@@ -7,5 +7,5 @@ local require = require(script.Parent.loader).load(script)
7
7
  local Table = require("Table")
8
8
 
9
9
  return Table.readonly({
10
- SCREEN_SHAKE_ENABLED_ATTRIBUTE = "RagdollScreenShakeEnabled"
11
- })
10
+ SCREEN_SHAKE_ENABLED_ATTRIBUTE = "RagdollScreenShakeEnabled",
11
+ })
@@ -7,8 +7,8 @@ local require = require(script.Parent.loader).load(script)
7
7
  local EnumUtils = require("EnumUtils")
8
8
  local Maid = require("Maid")
9
9
  local RxBrioUtils = require("RxBrioUtils")
10
- local RxR15Utils = require("RxR15Utils")
11
10
  local RxInstanceUtils = require("RxInstanceUtils")
11
+ local RxR15Utils = require("RxR15Utils")
12
12
 
13
13
  local RagdollAdditionalAttachmentUtils = {}
14
14
 
@@ -23,27 +23,47 @@ local V3_LEFT = Vector3.new(-1, 0, 0)
23
23
  -- of non-ideal axis orientation, but it's not as noticable there since the limits for natural
24
24
  -- motion are tighter for those joints anyway.
25
25
  local R15_ADDITIONAL_ATTACHMENTS = {
26
- {"UpperTorso", "RightShoulderRagdollAttachment", CFrame.fromMatrix(V3_ZERO, V3_RIGHT, V3_UP), "RightShoulderRigAttachment"},
27
- {"RightUpperArm", "RightShoulderRagdollAttachment", CFrame.fromMatrix(V3_ZERO, V3_DOWN, V3_RIGHT), "RightShoulderRigAttachment"},
28
- {"UpperTorso", "LeftShoulderRagdollAttachment", CFrame.fromMatrix(V3_ZERO, V3_LEFT, V3_UP), "LeftShoulderRigAttachment"},
29
- {"LeftUpperArm", "LeftShoulderRagdollAttachment", CFrame.fromMatrix(V3_ZERO, V3_DOWN, V3_LEFT), "LeftShoulderRigAttachment"},
26
+ {
27
+ "UpperTorso",
28
+ "RightShoulderRagdollAttachment",
29
+ CFrame.fromMatrix(V3_ZERO, V3_RIGHT, V3_UP),
30
+ "RightShoulderRigAttachment",
31
+ },
32
+ {
33
+ "RightUpperArm",
34
+ "RightShoulderRagdollAttachment",
35
+ CFrame.fromMatrix(V3_ZERO, V3_DOWN, V3_RIGHT),
36
+ "RightShoulderRigAttachment",
37
+ },
38
+ {
39
+ "UpperTorso",
40
+ "LeftShoulderRagdollAttachment",
41
+ CFrame.fromMatrix(V3_ZERO, V3_LEFT, V3_UP),
42
+ "LeftShoulderRigAttachment",
43
+ },
44
+ {
45
+ "LeftUpperArm",
46
+ "LeftShoulderRagdollAttachment",
47
+ CFrame.fromMatrix(V3_ZERO, V3_DOWN, V3_LEFT),
48
+ "LeftShoulderRigAttachment",
49
+ },
30
50
  }
31
51
 
32
52
  local R6_ADDITIONAL_ATTACHMENTS = {
33
- {"Head", "NeckAttachment", CFrame.new(0, -0.5, 0)},
34
- {"Torso", "NeckAttachment", CFrame.new(0, 1, 0)},
53
+ { "Head", "NeckAttachment", CFrame.new(0, -0.5, 0) },
54
+ { "Torso", "NeckAttachment", CFrame.new(0, 1, 0) },
35
55
 
36
- {"Torso", "RightShoulderRagdollAttachment", CFrame.fromMatrix(Vector3.new(1, 0.5, 0), V3_RIGHT, V3_UP)},
37
- {"Right Arm", "RightShoulderRagdollAttachment", CFrame.fromMatrix(Vector3.new(-0.5, 0.5, 0), V3_DOWN, V3_RIGHT)},
56
+ { "Torso", "RightShoulderRagdollAttachment", CFrame.fromMatrix(Vector3.new(1, 0.5, 0), V3_RIGHT, V3_UP) },
57
+ { "Right Arm", "RightShoulderRagdollAttachment", CFrame.fromMatrix(Vector3.new(-0.5, 0.5, 0), V3_DOWN, V3_RIGHT) },
38
58
 
39
- {"Torso", "LeftShoulderRagdollAttachment", CFrame.fromMatrix(Vector3.new(-1, 0.5, 0), V3_LEFT, V3_UP)},
40
- {"Left Arm", "LeftShoulderRagdollAttachment", CFrame.fromMatrix(Vector3.new(0.5, 0.5, 0), V3_DOWN, V3_LEFT)},
59
+ { "Torso", "LeftShoulderRagdollAttachment", CFrame.fromMatrix(Vector3.new(-1, 0.5, 0), V3_LEFT, V3_UP) },
60
+ { "Left Arm", "LeftShoulderRagdollAttachment", CFrame.fromMatrix(Vector3.new(0.5, 0.5, 0), V3_DOWN, V3_LEFT) },
41
61
 
42
- {"Torso", "RightHipAttachment", CFrame.new(0.5, -1, 0)},
43
- {"Right Leg", "RightHipAttachment", CFrame.new(0, 1, 0)},
62
+ { "Torso", "RightHipAttachment", CFrame.new(0.5, -1, 0) },
63
+ { "Right Leg", "RightHipAttachment", CFrame.new(0, 1, 0) },
44
64
 
45
- {"Torso", "LeftHipAttachment", CFrame.new(-0.5, -1, 0)},
46
- {"Left Leg", "LeftHipAttachment", CFrame.new(0, 1, 0)},
65
+ { "Torso", "LeftHipAttachment", CFrame.new(-0.5, -1, 0) },
66
+ { "Left Leg", "LeftHipAttachment", CFrame.new(0, 1, 0) },
47
67
  }
48
68
 
49
69
  function RagdollAdditionalAttachmentUtils.getAdditionalAttachmentData(rigType)
@@ -67,8 +87,8 @@ function RagdollAdditionalAttachmentUtils.ensureAdditionalAttachments(character,
67
87
 
68
88
  if baseAttachmentName then
69
89
  local observable = RxBrioUtils.flatCombineLatest({
70
- part = RxR15Utils.observeCharacterPartBrio(character, partName);
71
- baseAttachment = RxR15Utils.observeRigAttachmentBrio(character, partName, baseAttachmentName);
90
+ part = RxR15Utils.observeCharacterPartBrio(character, partName),
91
+ baseAttachment = RxR15Utils.observeRigAttachmentBrio(character, partName, baseAttachmentName),
72
92
  })
73
93
 
74
94
  topMaid:GiveTask(observable:Subscribe(function(state)
@@ -78,10 +98,12 @@ function RagdollAdditionalAttachmentUtils.ensureAdditionalAttachments(character,
78
98
  local attachment = Instance.new("Attachment")
79
99
  attachment.Name = attachmentName
80
100
 
81
- maid:GiveTask(RxInstanceUtils.observeProperty(state.baseAttachment, "CFrame"):Subscribe(function(baseCFrame)
82
- attachment.CFrame = baseCFrame * cframe
83
- attachment.Parent = state.part -- event ordering...
84
- end))
101
+ maid:GiveTask(
102
+ RxInstanceUtils.observeProperty(state.baseAttachment, "CFrame"):Subscribe(function(baseCFrame)
103
+ attachment.CFrame = baseCFrame * cframe
104
+ attachment.Parent = state.part -- event ordering...
105
+ end)
106
+ )
85
107
 
86
108
  maid:GiveTask(attachment)
87
109
 
@@ -111,4 +133,4 @@ function RagdollAdditionalAttachmentUtils.ensureAdditionalAttachments(character,
111
133
  return topMaid
112
134
  end
113
135
 
114
- return RagdollAdditionalAttachmentUtils
136
+ return RagdollAdditionalAttachmentUtils
@@ -12,172 +12,172 @@ local Workspace = game:GetService("Workspace")
12
12
  local EnumUtils = require("EnumUtils")
13
13
  local Maid = require("Maid")
14
14
  local RagdollMotorLimitData = require("RagdollMotorLimitData")
15
+ local Rx = require("Rx")
15
16
  local RxBrioUtils = require("RxBrioUtils")
16
17
  local RxInstanceUtils = require("RxInstanceUtils")
17
- local RxR15Utils = require("RxR15Utils")
18
- local Rx = require("Rx")
19
18
  local RxPhysicsUtils = require("RxPhysicsUtils")
19
+ local RxR15Utils = require("RxR15Utils")
20
20
 
21
21
  local RagdollBallSocketUtils = {}
22
22
 
23
23
  local R6_RAGDOLL_RIG = {
24
24
  {
25
- part0Name = "Torso";
26
- part1Name ="Head",
27
- attachmentName = "NeckAttachment";
28
- motorParentName = "Torso";
29
- motorName = "Neck";
30
- limitData = RagdollMotorLimitData.R6_NECK_LIMITS;
31
- };
25
+ part0Name = "Torso",
26
+ part1Name = "Head",
27
+ attachmentName = "NeckAttachment",
28
+ motorParentName = "Torso",
29
+ motorName = "Neck",
30
+ limitData = RagdollMotorLimitData.R6_NECK_LIMITS,
31
+ },
32
32
  {
33
- part0Name = "Torso";
34
- part1Name ="Left Leg";
35
- attachmentName = "LeftHipAttachment";
36
- motorParentName = "Torso";
37
- motorName = "Left Hip";
38
- limitData = RagdollMotorLimitData.R6_HIP_LIMITS;
39
- };
33
+ part0Name = "Torso",
34
+ part1Name = "Left Leg",
35
+ attachmentName = "LeftHipAttachment",
36
+ motorParentName = "Torso",
37
+ motorName = "Left Hip",
38
+ limitData = RagdollMotorLimitData.R6_HIP_LIMITS,
39
+ },
40
40
  {
41
- part0Name = "Torso";
42
- part1Name ="Right Leg";
43
- attachmentName = "RightHipAttachment";
44
- motorParentName = "Torso";
45
- motorName = "Right Hip";
46
- limitData = RagdollMotorLimitData.R6_HIP_LIMITS;
47
- };
41
+ part0Name = "Torso",
42
+ part1Name = "Right Leg",
43
+ attachmentName = "RightHipAttachment",
44
+ motorParentName = "Torso",
45
+ motorName = "Right Hip",
46
+ limitData = RagdollMotorLimitData.R6_HIP_LIMITS,
47
+ },
48
48
  {
49
- part0Name = "Torso";
50
- part1Name ="Left Arm";
51
- attachmentName = "LeftShoulderRagdollAttachment";
52
- motorParentName = "Torso";
53
- motorName = "Left Shoulder";
54
- limitData = RagdollMotorLimitData.R6_SHOULDER_LIMITS;
55
- };
49
+ part0Name = "Torso",
50
+ part1Name = "Left Arm",
51
+ attachmentName = "LeftShoulderRagdollAttachment",
52
+ motorParentName = "Torso",
53
+ motorName = "Left Shoulder",
54
+ limitData = RagdollMotorLimitData.R6_SHOULDER_LIMITS,
55
+ },
56
56
  {
57
- part0Name = "Torso";
58
- part1Name ="Right Arm";
59
- attachmentName = "RightShoulderRagdollAttachment";
60
- motorParentName = "Torso";
61
- motorName = "Right Shoulder";
62
- limitData = RagdollMotorLimitData.R6_SHOULDER_LIMITS;
63
- };
57
+ part0Name = "Torso",
58
+ part1Name = "Right Arm",
59
+ attachmentName = "RightShoulderRagdollAttachment",
60
+ motorParentName = "Torso",
61
+ motorName = "Right Shoulder",
62
+ limitData = RagdollMotorLimitData.R6_SHOULDER_LIMITS,
63
+ },
64
64
  }
65
65
 
66
66
  local R15_RAGDOLL_RIG = {
67
67
  {
68
- part0Name = "UpperTorso";
69
- part1Name = "Head";
70
- attachmentName = "NeckRigAttachment";
71
- motorParentName = "Head";
72
- motorName = "Neck";
73
- limitData = RagdollMotorLimitData.NECK_LIMITS;
74
- };
68
+ part0Name = "UpperTorso",
69
+ part1Name = "Head",
70
+ attachmentName = "NeckRigAttachment",
71
+ motorParentName = "Head",
72
+ motorName = "Neck",
73
+ limitData = RagdollMotorLimitData.NECK_LIMITS,
74
+ },
75
75
  {
76
- part0Name = "LowerTorso";
77
- part1Name = "UpperTorso";
78
- attachmentName = "WaistRigAttachment";
79
- motorParentName = "UpperTorso";
80
- motorName = "Waist";
81
- limitData = RagdollMotorLimitData.WAIST_LIMITS;
82
- };
76
+ part0Name = "LowerTorso",
77
+ part1Name = "UpperTorso",
78
+ attachmentName = "WaistRigAttachment",
79
+ motorParentName = "UpperTorso",
80
+ motorName = "Waist",
81
+ limitData = RagdollMotorLimitData.WAIST_LIMITS,
82
+ },
83
83
  {
84
- part0Name = "UpperTorso";
85
- part1Name = "LeftUpperArm";
86
- attachmentName = "LeftShoulderRagdollAttachment";
87
- motorParentName = "LeftUpperArm";
88
- motorName = "LeftShoulder";
89
- limitData = RagdollMotorLimitData.SHOULDER_LIMITS;
90
- };
84
+ part0Name = "UpperTorso",
85
+ part1Name = "LeftUpperArm",
86
+ attachmentName = "LeftShoulderRagdollAttachment",
87
+ motorParentName = "LeftUpperArm",
88
+ motorName = "LeftShoulder",
89
+ limitData = RagdollMotorLimitData.SHOULDER_LIMITS,
90
+ },
91
91
  {
92
- part0Name = "LeftUpperArm";
93
- part1Name = "LeftLowerArm";
94
- attachmentName = "LeftElbowRigAttachment";
95
- motorParentName = "LeftLowerArm";
96
- motorName = "LeftElbow";
97
- limitData = RagdollMotorLimitData.ELBOW_LIMITS;
98
- };
92
+ part0Name = "LeftUpperArm",
93
+ part1Name = "LeftLowerArm",
94
+ attachmentName = "LeftElbowRigAttachment",
95
+ motorParentName = "LeftLowerArm",
96
+ motorName = "LeftElbow",
97
+ limitData = RagdollMotorLimitData.ELBOW_LIMITS,
98
+ },
99
99
  {
100
- part0Name = "LeftLowerArm";
101
- part1Name = "LeftHand";
102
- attachmentName = "LeftWristRigAttachment";
103
- motorParentName = "LeftHand";
104
- motorName = "LeftWrist";
105
- limitData = RagdollMotorLimitData.WRIST_LIMITS;
106
- };
100
+ part0Name = "LeftLowerArm",
101
+ part1Name = "LeftHand",
102
+ attachmentName = "LeftWristRigAttachment",
103
+ motorParentName = "LeftHand",
104
+ motorName = "LeftWrist",
105
+ limitData = RagdollMotorLimitData.WRIST_LIMITS,
106
+ },
107
107
  {
108
- part0Name = "UpperTorso";
109
- part1Name = "RightUpperArm";
110
- attachmentName = "RightShoulderRagdollAttachment";
111
- motorParentName = "RightUpperArm";
112
- motorName = "RightShoulder";
113
- limitData = RagdollMotorLimitData.SHOULDER_LIMITS;
114
- };
108
+ part0Name = "UpperTorso",
109
+ part1Name = "RightUpperArm",
110
+ attachmentName = "RightShoulderRagdollAttachment",
111
+ motorParentName = "RightUpperArm",
112
+ motorName = "RightShoulder",
113
+ limitData = RagdollMotorLimitData.SHOULDER_LIMITS,
114
+ },
115
115
  {
116
- part0Name = "RightUpperArm";
117
- part1Name = "RightLowerArm";
118
- attachmentName = "RightElbowRigAttachment";
119
- motorParentName = "RightLowerArm";
120
- motorName = "RightElbow";
121
- limitData = RagdollMotorLimitData.ELBOW_LIMITS;
122
- };
116
+ part0Name = "RightUpperArm",
117
+ part1Name = "RightLowerArm",
118
+ attachmentName = "RightElbowRigAttachment",
119
+ motorParentName = "RightLowerArm",
120
+ motorName = "RightElbow",
121
+ limitData = RagdollMotorLimitData.ELBOW_LIMITS,
122
+ },
123
123
  {
124
- part0Name = "RightLowerArm";
125
- part1Name = "RightHand";
126
- attachmentName = "RightWristRigAttachment";
127
- motorParentName = "RightHand";
128
- motorName = "RightWrist";
129
- limitData = RagdollMotorLimitData.WRIST_LIMITS;
130
- };
124
+ part0Name = "RightLowerArm",
125
+ part1Name = "RightHand",
126
+ attachmentName = "RightWristRigAttachment",
127
+ motorParentName = "RightHand",
128
+ motorName = "RightWrist",
129
+ limitData = RagdollMotorLimitData.WRIST_LIMITS,
130
+ },
131
131
 
132
132
  {
133
- part0Name = "LowerTorso";
134
- part1Name = "LeftUpperLeg";
135
- attachmentName = "LeftHipRigAttachment";
136
- motorParentName = "LeftUpperLeg";
137
- motorName = "LeftHip";
138
- limitData = RagdollMotorLimitData.HIP_LIMITS;
139
- };
133
+ part0Name = "LowerTorso",
134
+ part1Name = "LeftUpperLeg",
135
+ attachmentName = "LeftHipRigAttachment",
136
+ motorParentName = "LeftUpperLeg",
137
+ motorName = "LeftHip",
138
+ limitData = RagdollMotorLimitData.HIP_LIMITS,
139
+ },
140
140
  {
141
- part0Name = "LeftUpperLeg";
142
- part1Name = "LeftLowerLeg";
143
- attachmentName = "LeftKneeRigAttachment";
144
- motorParentName = "LeftLowerLeg";
145
- motorName = "LeftKnee";
146
- limitData = RagdollMotorLimitData.KNEE_LIMITS;
147
- };
141
+ part0Name = "LeftUpperLeg",
142
+ part1Name = "LeftLowerLeg",
143
+ attachmentName = "LeftKneeRigAttachment",
144
+ motorParentName = "LeftLowerLeg",
145
+ motorName = "LeftKnee",
146
+ limitData = RagdollMotorLimitData.KNEE_LIMITS,
147
+ },
148
148
  {
149
- part0Name = "LeftLowerLeg";
150
- part1Name = "LeftFoot";
151
- attachmentName = "LeftAnkleRigAttachment";
152
- motorParentName = "LeftFoot";
153
- motorName = "LeftAnkle";
154
- limitData = RagdollMotorLimitData.ANKLE_LIMITS;
155
- };
149
+ part0Name = "LeftLowerLeg",
150
+ part1Name = "LeftFoot",
151
+ attachmentName = "LeftAnkleRigAttachment",
152
+ motorParentName = "LeftFoot",
153
+ motorName = "LeftAnkle",
154
+ limitData = RagdollMotorLimitData.ANKLE_LIMITS,
155
+ },
156
156
 
157
157
  {
158
- part0Name = "LowerTorso";
159
- part1Name = "RightUpperLeg";
160
- attachmentName = "RightHipRigAttachment";
161
- motorParentName = "RightUpperLeg";
162
- motorName = "RightHip";
163
- limitData = RagdollMotorLimitData.HIP_LIMITS;
164
- };
158
+ part0Name = "LowerTorso",
159
+ part1Name = "RightUpperLeg",
160
+ attachmentName = "RightHipRigAttachment",
161
+ motorParentName = "RightUpperLeg",
162
+ motorName = "RightHip",
163
+ limitData = RagdollMotorLimitData.HIP_LIMITS,
164
+ },
165
165
  {
166
- part0Name = "RightUpperLeg";
167
- part1Name = "RightLowerLeg";
168
- attachmentName = "RightKneeRigAttachment";
169
- motorParentName = "RightLowerLeg";
170
- motorName = "RightKnee";
171
- limitData = RagdollMotorLimitData.KNEE_LIMITS;
172
- };
166
+ part0Name = "RightUpperLeg",
167
+ part1Name = "RightLowerLeg",
168
+ attachmentName = "RightKneeRigAttachment",
169
+ motorParentName = "RightLowerLeg",
170
+ motorName = "RightKnee",
171
+ limitData = RagdollMotorLimitData.KNEE_LIMITS,
172
+ },
173
173
  {
174
- part0Name = "RightLowerLeg";
175
- part1Name = "RightFoot";
176
- attachmentName = "RightAnkleRigAttachment";
177
- motorParentName = "RightFoot";
178
- motorName = "RightAnkle";
179
- limitData = RagdollMotorLimitData.ANKLE_LIMITS;
180
- };
174
+ part0Name = "RightLowerLeg",
175
+ part1Name = "RightFoot",
176
+ attachmentName = "RightAnkleRigAttachment",
177
+ motorParentName = "RightFoot",
178
+ motorName = "RightAnkle",
179
+ limitData = RagdollMotorLimitData.ANKLE_LIMITS,
180
+ },
181
181
  }
182
182
 
183
183
  function RagdollBallSocketUtils.getRigData(rigType)
@@ -207,19 +207,24 @@ function RagdollBallSocketUtils.ensureBallSockets(character, rigType)
207
207
  RxBrioUtils.switchMapBrio(function(motor)
208
208
  if motor then
209
209
  return RxBrioUtils.flatCombineLatest({
210
- motor = Rx.of(motor);
211
- part1 = RxR15Utils.observeCharacterPartBrio(character, part1Name);
212
- attachment0 = RxR15Utils.observeRigAttachmentBrio(character, part0Name, attachmentName);
213
- attachment1 = RxR15Utils.observeRigAttachmentBrio(character, part1Name, attachmentName);
214
- limitData = Rx.of(limitData);
210
+ motor = Rx.of(motor),
211
+ part1 = RxR15Utils.observeCharacterPartBrio(character, part1Name),
212
+ attachment0 = RxR15Utils.observeRigAttachmentBrio(character, part0Name, attachmentName),
213
+ attachment1 = RxR15Utils.observeRigAttachmentBrio(character, part1Name, attachmentName),
214
+ limitData = Rx.of(limitData),
215
215
  })
216
216
  else
217
217
  return Rx.of({})
218
218
  end
219
- end);
219
+ end),
220
220
  RxBrioUtils.where(function(motorState)
221
- return motorState.attachment0 and motorState.attachment1 and motorState.part1 and motorState.motor and true or false
222
- end);
221
+ return motorState.attachment0
222
+ and motorState.attachment1
223
+ and motorState.part1
224
+ and motorState.motor
225
+ and true
226
+ or false
227
+ end),
223
228
  })
224
229
 
225
230
  topMaid:GiveTask(observable:Subscribe(function(brio)
@@ -241,25 +246,22 @@ function RagdollBallSocketUtils.ensureBallSockets(character, rigType)
241
246
  ballSocket.Attachment0 = motorState.attachment0
242
247
  ballSocket.Attachment1 = motorState.attachment1
243
248
 
244
- maid:GiveTask(limitValue.UpperAngle:Observe()
245
- :Subscribe(function(value)
246
- ballSocket.UpperAngle = value
247
- end))
248
- maid:GiveTask(limitValue.TwistLowerAngle:Observe()
249
- :Subscribe(function(value)
250
- ballSocket.TwistLowerAngle = value
251
- end))
252
- maid:GiveTask(limitValue.TwistUpperAngle:Observe()
253
- :Subscribe(function(value)
254
- ballSocket.TwistUpperAngle = value
255
- end))
249
+ maid:GiveTask(limitValue.UpperAngle:Observe():Subscribe(function(value)
250
+ ballSocket.UpperAngle = value
251
+ end))
252
+ maid:GiveTask(limitValue.TwistLowerAngle:Observe():Subscribe(function(value)
253
+ ballSocket.TwistLowerAngle = value
254
+ end))
255
+ maid:GiveTask(limitValue.TwistUpperAngle:Observe():Subscribe(function(value)
256
+ ballSocket.TwistUpperAngle = value
257
+ end))
256
258
 
257
259
  maid:GiveTask(Rx.combineLatest({
258
- frictionTorque = limitValue.FrictionTorque:Observe();
259
- referenceGravity = limitValue.ReferenceGravity:Observe();
260
- referenceMass = limitValue.ReferenceMass:Observe();
261
- gravity = RxInstanceUtils.observeProperty(Workspace, "Gravity");
262
- mass = RxPhysicsUtils.observePartMass(motorState.part1);
260
+ frictionTorque = limitValue.FrictionTorque:Observe(),
261
+ referenceGravity = limitValue.ReferenceGravity:Observe(),
262
+ referenceMass = limitValue.ReferenceMass:Observe(),
263
+ gravity = RxInstanceUtils.observeProperty(Workspace, "Gravity"),
264
+ mass = RxPhysicsUtils.observePartMass(motorState.part1),
263
265
  }):Subscribe(function(state)
264
266
  local gravityScale = state.gravity / state.referenceGravity
265
267
  local referenceMass = state.referenceMass
@@ -268,12 +270,10 @@ function RagdollBallSocketUtils.ensureBallSockets(character, rigType)
268
270
  end))
269
271
 
270
272
  ballSocket.Parent = motorState.part1
271
-
272
273
  end))
273
274
  end
274
275
 
275
276
  return topMaid
276
277
  end
277
278
 
278
-
279
- return RagdollBallSocketUtils
279
+ return RagdollBallSocketUtils