Skip to content

Commit

Permalink
fix: ragdoll lag fix
Browse files Browse the repository at this point in the history
  • Loading branch information
imagerymartin committed Dec 10, 2024
1 parent a9256ca commit ca7cac7
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions src/ragdoll/src/Shared/Rigging/RagdollMotorUtils.lua
Original file line number Diff line number Diff line change
Expand Up @@ -201,12 +201,12 @@ function RagdollMotorUtils.setupRagdollRootPartMotor(motor, part0, part1)
weld.C0 = innerState.C0 * innerState.Transform
end))

if weld:IsA("Motor6D") then
-- if weld:IsA("Motor6D") then
-- Suppress animations on any weld connection
weldMaid:GiveTask(RunService.Stepped:Connect(function()
weld.Transform = CFrame.new()
end))
end
-- weldMaid:GiveTask(RunService.Stepped:Connect(function()
-- weld.Transform = CFrame.new()
-- end))
-- end

weldMaid:GiveTask(RxInstanceUtils.observeProperty(motor, "C1"):Subscribe(function(c1)
weld.C1 = c1
Expand All @@ -233,13 +233,13 @@ function RagdollMotorUtils.setupRagdollRootPartMotor(motor, part0, part1)
end))

-- Lerp smoothly to 0 to avoid jarring camera.
maid:GiveTask(RunService.Stepped:Connect(function()
local target = QFrame.toCFrame(lastTransformSpring.p)
if target then
transformValue.Value = target
motor.Transform = target
end
end))
-- maid:GiveTask(RunService.Stepped:Connect(function()
-- local target = QFrame.toCFrame(lastTransformSpring.p)
-- if target then
-- transformValue.Value = target
-- motor.Transform = target
-- end
-- end))

motor.Enabled = false

Expand Down

0 comments on commit ca7cac7

Please sign in to comment.