Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Help with camera Manipulation?

Asked by 10 years ago

How would I use interpolate to move my camera smoothly? An example of use in a script would be great! Quoted directly from the wiki:

1void Interpolate ( CoordinateFrame endPos, CoordinateFrame endFocus, float duration )

Smoothly tweens the camera from the current coordinate frame to the supplied one with the given focus over the duration.

1 answer

Log in to vote
0
Answered by
Mr_Octree 101
10 years ago

Here you go:

01wait(1)
02game.Players.PlayerAdded:connect(function(pl)
03    pl.CharacterAdded:connect(function(c)
04        local sclone = script:Clone()
05        sclone.Parent = c
06    end)
07end)
08local cam = game.Workspace.CurrentCamera
09local cframe = cam.CoordinateFrame
10local endPos = CFrame.new(30,20,30)
11local endFocus = CFrame.new(4,0,4)
12cam.CameraType = "Scriptable"
13 
14cam:Interpolate(endPos,endFocus,5)
Ad

Answer this question