hey so i have this little, viewport model system for my guns! Im having trouble adding gun sway tho… animations just dont cut it. I hear people are using springs but cant find anything helpful to me about it. Any help?
This function is running for ever renderstepped:
function WeaponAlignADS()
if Player.Character.Humanoid.Health == 0 then
if Camera:FindFirstChild("VM") ~= nil then
Camera.VM:Destroy()
end
end
if Camera:FindFirstChild("VM") ~= nil and aiming == false then
UIS.MouseIconEnabled = false
Camera.VM:SetPrimaryPartCFrame(Camera.CFrame * CFrame.new(tool.vX.Value,tool.vY.Value,tool.vZ.Value) * CFrame.Angles(0, 0, 0))
end
end
function WeaponAlignADS()
if Player.Character.Humanoid.Health == 0 then
if Camera:FindFirstChild("VM") ~= nil then
Camera.VM:Destroy()
end
end
if Camera:FindFirstChild("VM") ~= nil and aiming == false then
UIS.MouseIconEnabled = false
local cf = Camera.CFrame * CFrame.new(tool.vX.Value,tool.vY.Value,tool.vZ.Value) * CFrame.Angles(0, 0, 0)
Camera.VM:SetPrimaryPartCFrame(Camera.VM:GetPrimaryPartCFrame():Lerp(cf,1/60))
end
end