-
I want to achieve that the sway system is independent on fps so its not too wiggly for other user or too stiff
-
The issue is that the sway looks different on 60 fps 30 fps and 120 fps and more
-
I tried looking on the devforum if someone had the same issue but i didnt really find out how to fix my problem
game:GetService("RunService").RenderStepped:Connect(function(deltaTime)
mouseDelta = game:GetService("UserInputService"):GetMouseDelta()
local intensityX = mouseDelta.X/700
local intensityY = mouseDelta.Y/500
local sensitivity = 0.1
local DeadZone = 0.07
if mouseDelta.X <= sensitivity and Equipped then
UnlockedOffsetCFrame = Vector3.new(UnlockedOffsetCFrame.X,UnlockedOffsetCFrame.Y - intensityX,0)
---------------------------------------------
elseif mouseDelta.X >= sensitivity and Equipped then
UnlockedOffsetCFrame = Vector3.new(UnlockedOffsetCFrame.X,UnlockedOffsetCFrame.Y - intensityX,0)
---------------------------------------------
end
if mouseDelta.Y <= sensitivity and Equipped then
UnlockedOffsetCFrame = Vector3.new(UnlockedOffsetCFrame.X - intensityY,UnlockedOffsetCFrame.Y,0)
---------------------------------------------
elseif mouseDelta.Y >= sensitivity and Equipped then
UnlockedOffsetCFrame = Vector3.new(UnlockedOffsetCFrame.X - intensityY,UnlockedOffsetCFrame.Y,0)
---------------------------------------------
end
UnlockedOffsetCFrame = Vector3.new(
math.clamp(UnlockedOffsetCFrame.X,-0.05,0.05),
math.clamp(UnlockedOffsetCFrame.Y,-DeadZone,DeadZone),
math.clamp(UnlockedOffsetCFrame.Z,-DeadZone,DeadZone)
)
if Aiming then
UnlockedOffsetCFrame = Vector3.new(0,0,0)
end
mouseDelta = Vector2.new(math.clamp(mouseDelta.X,-10,10),math.clamp(mouseDelta.Y,-10,10))
unlok:shove(UnlockedOffsetCFrame)
unlocked = unlok:update(deltaTime)
sway1:shove(Vector3.new(mouseDelta.x / 200,mouseDelta.y / 200))
statusSway:shove(Vector3.new(mouseDelta.x / 5000,mouseDelta.y / 5000))
strafe:shove(strafeCFrame)
walking:shove(WalkCFrame)
sway = sway1:update(deltaTime)
swayTs = statusSway:update(deltaTime)
strafing = strafe:update(deltaTime)
walk = walking:update(deltaTime)
jumps = jumpSpring:update(deltaTime)
end)
Thank you.