Advertisement
GaryScripts

Camera Bobble Script

Jan 26th, 2020
594
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.59 KB | None | 0 0
  1. local plr = game.Players.LocalPlayer
  2. local Humanoid = plr.Character.Humanoid
  3. local RS = game:GetService("RunService")
  4.  
  5. function Update()
  6.     local CT = tick()
  7.     if Humanoid.MoveDirection.Magnitude > 0 then
  8.         local BobX = math.cos(CT * 10) * 1
  9.         local BobY = math.abs(math.sin(CT * 10)) * 1
  10.        
  11.         local Bob = Vector3.new(BobX, BobY, 0)
  12.        
  13.         Humanoid.CameraOffset = Humanoid.CameraOffset:Lerp(Bob, .1)
  14.     else
  15.         Humanoid.CameraOffset = Humanoid.CameraOffset * .5
  16.     end
  17. end
  18.  
  19. RS.RenderStepped:Connect(Update)
  20.  
  21. -- Put inside of StarterCharacterScripts!
  22. -- Make sure it's a LocalScript so It Works.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement