Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Local script in StarterCharacterScript
- local RunService = game:GetService("RunService")
- local character = script.Parent
- local humanoid = character:WaitForChild("Humanoid")
- function updateBobbleEffect()
- local CurrentTime = tick()
- if humanoid.MoveDirection.Magnitude > 0 then
- local BobbleX = math.cos(CurrentTime * 10) * .25
- local BobbleY = math.abs(math.sin(CurrentTime * 10)) * .25
- local Bobble = Vector3.new(BobbleX, BobbleY, 0)
- humanoid.CameraOffset = humanoid.CameraOffset:lerp(Bobble, .25)
- else
- humanoid.CameraOffset = humanoid.CameraOffset * .75
- end
- end
- RunService.RenderStepped:Connect(updateBobbleEffect)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement