How to get a normal camera on the player after a camera manipulation

  1. What do you want to achieve? After a manipulation of the camera with TweenService, I would like to be able to recover the normal view on the player, because with this script the camera remains blocked at its new location. Thank you
local ts = game:GetService("TweenService")
local player = game.Players.LocalPlayer
local character = player.Character or player.CharacterAdded:Wait()
local camera = workspace.CurrentCamera
local point1 = workspace:WaitForChild("point1")

game.Workspace.tweencamera.Touched:Connect(function(hit)
	if hit.Parent.Name == player.Name then
		game.Workspace.tweencamera.CanTouch = false
		camera.CameraType = Enum.CameraType.Scriptable
		local tween = ts:Create(camera, TweenInfo.new(3), {["CFrame"] = point1.CFrame})
		tween:Play()
	end
end)
2 Likes

It is a simple matter of setting the CameraType back to Enum.CameraType.Custom, which is the default behavior for the camera. Probably after the tween finished playing with tween.Completed:Wait() which will yield code until the tween finished, meaning anything after it will not run until the tween finished.

3 Likes

Thank you for your fast answer, it was the solution !

2 Likes