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 9 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:


void 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
9 years ago

Here you go:

wait(1)
game.Players.PlayerAdded:connect(function(pl)
    pl.CharacterAdded:connect(function(c)
        local sclone = script:Clone()
        sclone.Parent = c
    end)
end)
local cam = game.Workspace.CurrentCamera
local cframe = cam.CoordinateFrame
local endPos = CFrame.new(30,20,30)
local endFocus = CFrame.new(4,0,4)
cam.CameraType = "Scriptable"

cam:Interpolate(endPos,endFocus,5)
Ad

Answer this question