Advertisement
Guest User

Untitled

a guest
May 6th, 2016
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.52 KB | None | 0 0
  1. local EndCFrame = CFrame.new()
  2. local cam = workspace.CurrentCamera
  3.  
  4. function LerpCF(camera, finish, t) -- t is time it takes to move from start to finish
  5. coroutine.resume(coroutine.create(function()
  6. local start = tick()
  7. local progress = 0
  8. repeat
  9. progress = math.min(1,(tick()-start)/t)
  10. camera.CoordinateFrame:lerp(finish, progress/1)
  11. game:GetService("RunService").RenderStepped:wait()
  12. until progress == 1
  13. end))
  14. end
  15.  
  16. ---Example
  17. LerpCF(cam, EndCFrame, 1)-- moves camera to the EndCframe in 1 sec
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement