Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Help with camera Manipulation?

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

✓ Accepted answer

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)

This discussion is preserved as it was. New answers, comments, and votes are closed.