I have this script that tweens the player’s camera. The first tween works just fine, but for some reason, after it has played, it switches back to Enum.CameraType.Custom, and the camera’s Subject goes back to the Humanoid.
script.Parent.Start.MouseButton1Click:Connect(function()
if not debounce then
debounce = true
script.Parent.Start:Destroy()
cam.CameraType = Enum.CameraType.Scriptable
wait()
local tween1 = tweenservice:Create(
cam,
TweenInfo.new(1, Enum.EasingStyle.Quad, Enum.EasingDirection.In),
{
CFrame = startpos.CFrame
}
)
tween1:Play()
wait(1)
cam.CFrame = startpos.CFrame
local tween2 = tweenservice:Create(
cam,
TweenInfo.new(3, Enum.EasingStyle.Sine, Enum.EasingDirection.Out),
{
CFrame = endpos.CFrame
}
)
tween2:Play()
wait(3)
cam.CameraType = Enum.CameraType.Custom
canmove.Value = true
hum.WalkSpeed = 16
hum.JumpPower = 50
end
end)
Help is greatly appreciated.