Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local EndCFrame = CFrame.new()
- local cam = workspace.CurrentCamera
- function LerpCF(camera, finish, t) -- t is time it takes to move from start to finish
- coroutine.resume(coroutine.create(function()
- local start = tick()
- local progress = 0
- repeat
- progress = math.min(1,(tick()-start)/t)
- camera.CoordinateFrame:lerp(finish, progress/1)
- game:GetService("RunService").RenderStepped:wait()
- until progress == 1
- end))
- end
- ---Example
- LerpCF(cam, EndCFrame, 1)-- moves camera to the EndCframe in 1 sec
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement