How would i tween my camera smoothly back to the original?

Hello, how would i tween my camera smoothly back to the original?


local UnderCam = game.Workspace.Bed1.Camera
local CurrentCamera = game.Workspace.CurrentCamera
local Camera = game.Workspace.Camera
local cameraCFrame = workspace.CurrentCamera.CFrame

local Humanoid = game.Players.LocalPlayer.Character:WaitForChild("Humanoid")

local TweenService = game:GetService("TweenService")
local CameraTweenInfo = TweenInfo.new(1.3, Enum.EasingStyle.Quad, Enum.EasingDirection.InOut)

local Remote = game:WaitForChild("ReplicatedStorage"):WaitForChild("LookUnder"):WaitForChild("Enter1")

local InUse = false

local function Update1()
	if game.Workspace.Bed1.Useing.Value == true then
		InUse = true
	else
		if game.Workspace.Bed1.Useing.Value == true then
			InUse = false
		end
	end
end

game.Workspace.Bed1.Useing.Changed:Connect(Update1)

Remote.OnClientEvent:Connect(function()
	if not InUse then
	local NextTween = {CFrame = UnderCam.CFrame}
	local TweenToNext = TweenService:Create(CurrentCamera, CameraTweenInfo, NextTween)	
	TweenToNext:Play()
	UnderCam.Parent.LookUnderProx.Enter.Enabled = false
	UnderCam.Parent.Exit.Exit.Enabled = true
		Camera.CameraType = Enum.CameraType.Scriptable
	else
		if InUse then
			
		end
	end
end)
1 Like

Back to the player:

local function ReleaseCamera()
	
	local camera = workspace.CurrentCamera 
	camera.CameraType = Enum.CameraType.Custom
	local tween = TweenService:Create(
		camera,
		TweenInfo.new(1.5),
		{CFrame = player.Character.Head.CFrame * CFrame.new(0,0.5,10)}
	)
	tween:Play()
	tween.Completed:Wait()
	player.CameraMinZoomDistance = 0.5
	player.CameraMaxZoomDistance = 10
	camera.Focus = player.Character.Head.CFrame * CFrame.new(0,0.5,10)
	camera.CFrame = player.Character.Head.CFrame * CFrame.new(0,0.5,10)
	camera.CameraSubject = player.Character.Humanoid
	task.wait(0.5) 
	player.CameraMaxZoomDistance = 400
end

I like it to keep a 10 blocks “zoom” when it’s back but you don’t have to do that at all.

oh wait, sorry but i forgot to tell you, i had custom camera settings,

char.Humanoid.CameraOffset = Vector3.new(0, 0, -1)
player.CameraMaxZoomDistance = 0.5 -- force first person
camera.FieldOfView = 100

this is all a first person script, could u help me make it work for the script u gave me please? thanks.