Advertisement
Navarone19_CH

ScreenShake System

Aug 1st, 2021
3,555
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.51 KB | None | 0 0
  1. local Runservice = game:GetService("RunService")
  2. local char = script.Parent
  3. local Humanoid = char:WaitForChild("Humanoid")
  4.  
  5. function Effect()
  6. local Time = tick()
  7. if Humanoid.MoveDirection.Magnitude > 0 then
  8. local X = math.cos(Time * 10) * 0.35
  9. local Y = math.abs(math.sin(Time * 10)) * 0.35
  10. local Shake = Vector3.new(X,Y,0)
  11. Humanoid.CameraOffset = Humanoid.CameraOffset:lerp(Shake,0.80)
  12. else
  13. Humanoid.CameraOffset = Humanoid.CameraOffset * 0.75
  14. end
  15. end
  16.  
  17. Runservice.RenderStepped:Connect(Effect)
  18.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement