How Would I Tween The Players Camera To A Part

How Would One Tween The Players Camera To A Part With A Local Script? Thanks For The Help

local tweenService = game:GetService("TweenService")

local camera = workspace.CurrentCamera

local changedCframe = false

function tweenCamera(time , endingPosition)
	changedCframe = true
	camera.CameraType = Enum.CameraType.Scriptable
	local tween = tweenService:Create(camera , TweenInfo.new(time) , {CFrame = endingPosition})
	tween:Play()
	tween.Completed:Wait()
end

function resetCamera()
	changedCframe = false
	camera.CameraType = Enum.CameraType.Custom
end

local endingPosition = CFrame.new() --change to your part's CFrame
tweenCamera(.2 , endingPosition) 

-- resetCamera() --  use this to reset the camera

Thanks I Slightly Modified This And Now It Works Perfect

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.