--player.CharacterAdded:Wait()
--player.Character:WaitForChild("Humanoid")
--player.Character:WaitForChild("HumanoidRootPart")
--camera.CameraSubject = player.Character.HumanoidRootPart


local function onCharacterAdded(character)
	character:WaitForChild("HumanoidRootPart")
	camera.CameraSubject = player.Character.HumanoidRootPart
end

game.Players.LocalPlayer.CharacterAdded:Connect(onCharacterAdded)

game:GetService("RunService").Stepped:connect(function(currTime,dt)
	if(isPlayerRevive and player.Character ~= nil) then
		local character = player.Character
		if(character:FindFirstChild("HumanoidRootPart") == nil) then
			return
		end
		local torso = character.HumanoidRootPart
		local newFrame  = 	CFrame.new(Vector3.new(torso.Position.X , torso.Position.Y + 10, torso.Position.Z - 10) + currentPosition,
			Vector3.new(torso.Position.X,  torso.Position.Y, torso.Position.Z - 10) + currentTarget)
		camera.CFrame = camera.CFrame:Lerp(newFrame, cameraSpeed * dt)
	end
	
end)
