Camera back to player

Hi devs, i just maked a script that change cameras to differents part but now am stuck bcs when i try to give the camera back to the player it doesn’t work . Does any one have the solution? tnks

	local transitionTime1 = 3
	local startPosition1 = cam.CFrame
	local endPosition1 = camera1.CFrame

	local tweenInfo1 = TweenInfo.new(transitionTime1)
	local tween1 = TweenService:Create(cam, tweenInfo1, {CFrame = endPosition1})
	
	local camera2 = workspace.Cameras.Camera2
	
	
	tween1:Play()

	tween1.Completed:Connect(function()
		cam.CameraSubject = camera1
		part = camera1
		print("Camera1")

		wait(47.3) -- 39
		
		TweenFrameVisible:Play()
		
		wait(0.7)
		renderStepConnection:Disconnect()  
		cam.CameraType = "Scriptable"
		cam.CFrame = camera2.CFrame

		
		print("Camera2")
		wait(3)
		TweenFrameInvisible:Play()
		wait(0.2)
		game.Workspace.Intro.Gasp:Play()
		wait(1.4)
		TweenFrameVisible:Play()
		-- afficher le nom du jeu.
		wait(3)
		TweenFrameInvisible:Play()
	
	

		
		print("Camera back")

		local character = LocalPlayer.Character

		if character then
			cam.CameraSubject = character
		end

		UIS.ModalEnabled = true
		StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.All, true)
	end)
end)
local camera = workspace.CurrentCamera
camera.CameraSubject = game.Players.LocalPlayer.Character.Humanoid

I just tried it and it still doesn’t work.

Have you tried to turn cameraType back to custom? (or fixed i dont remember which)

1 Like

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