CameraType switches back to Custom, even when not asked to

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.

Is it not this..?

30 characters

Nope, it still switches to Custom either way, and focuses back onto the Humanoid

Is there another script that could possibly be interfering with this one?
Or where is this script located?

Otherwise I think your code should be fine.

1 Like

Ah yes, you’re right. Just found a code that switches to Custom inside a RenderStepped function lol. Thanks for reminding me!

1 Like

No problem :+1:

Glad to help out