Help with creating better weapon sway?

Got it working! I had to update the camera CFrame after every frame. Thank you so much!

Finished code:

local TweenDb = false

local tweenInfo = TweenInfo.new(0.1,Enum.EasingStyle.Linear,Enum.EasingDirection.Out,0,false,0)



runServ.RenderStepped:Connect(function()
	   if not debounce then
		local part = viewer.PrimaryPart
local goal = {CFrame = Camera.CFrame}
      debounce = true
      -- run tween

      local tween = TweenServ:Create(part,tweenInfo,goal)
      local t 
      t = tween.Completed:Connect(function()
         print("completed")
         debounce = false
         t:Disconnect()
       end)

      tween:Play()
   end
end)

Once again, Thank you!!!

1 Like