Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local runService = game:GetService("RunService")
- local character = script.Parent
- local humanoid = character:WaitForChild("Humanoid")
- function updateBobbleEffect()
- local currentTime = tick()
- if humanoid.WalkSpeed >= 16 and humanoid.Sit == false then
- if humanoid.MoveDirection.Magnitude > 0 then
- local bobbleX = math.cos(currentTime * 10) * .35
- local bobbleY = math.abs(math.sin(currentTime * 10)) * .35
- local bobble = Vector3.new(bobbleX, bobbleY, 0)
- humanoid.CameraOffset = humanoid.CameraOffset:lerp(bobble, .25)
- else
- humanoid.CameraOffset = humanoid.CameraOffset * .75
- end
- end
- end
- runService.RenderStepped:Connect(updateBobbleEffect)
Advertisement
Comments
-
- Yes Reply
-
- this is view bobbing, not camera shake
-
- dosen't work for me
Add Comment
Please, Sign In to add comment