Camera stuck after tweeing

I made a script that tween camera after clicking button, but after tween is done camera cant move and cant rotate

I changed CameraType to Fixed after tweeing, and set CameraSubject to humanoid but that didn’t help

local TS = game:GetService("TweenService")
local sgui = game:GetService("StarterGui")
local objectcamera = game.Workspace:WaitForChild("ObjectCamera")
local camera = game.Workspace.CurrentCamera

local ti = TweenInfo.new(
	0.5,
	Enum.EasingStyle.Linear,
	Enum.EasingDirection.InOut
)

local ticamera = TweenInfo.new(
	2.5,
	Enum.EasingStyle.Linear,
	Enum.EasingDirection.InOut
)

local gui = script.Parent
local playbutton = script.Parent.PlayButton

local cameraanimation

wait()

sgui:SetCore("ResetButtonCallback", false)
sgui:SetCoreGuiEnabled(Enum.CoreGuiType.All, false)

camera.CameraType = Enum.CameraType.Scriptable
camera.CFrame = objectcamera.CFrame

playbutton.Activated:Connect(function() -- Problem here
	cameraanimation = TS:Create(camera,ticamera,{CFrame = script.CFRAME.Value})
	cameraanimation:Play()
	cameraanimation.Completed:Wait()
	camera.CameraType = Enum.CameraType.Fixed
	camera.CameraSubject = game.Players.LocalPlayer.Character.Humanoid
end)

There the video

Enum.CameraType.Fixed is practically the same thing as Enum.CameraType.Scriptable but without the Scripting.

2 Likes

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