im currently experiencing issues with my weapon sway getting stuck for a bit before going to its original position. example:
External Mediathis is my code
local spring = require(script:WaitForChild("spring"))
local swaySpring = spring.new()
local maxRot = 10
local dampening = .2
local function ToRad(Number:number)
return math.rad(
math.clamp(
Number*dampening,
-maxRot,
maxRot
)
)
end
task.spawn(function()
runService.RenderStepped:Connect(function(dt)
local delta = -userInputService:GetMouseDelta()
local pos = Vector3.new(delta.X, delta.Y, 0)
swaySpring:shove(pos)
local updatedSway = swaySpring:update(dt)
viewmodel:PivotTo((workspace.CurrentCamera.CFrame * CFrame.new(Vector3.new(0.5,0,-1.8))) * CFrame.Angles(ToRad(updatedSway.Y), ToRad(updatedSway.X), 0))
end)
end)
this happens when i move my camera rapidly and then stop. as you can see, the viewmodel stops for a bit before going back to its position.