Camera breaking beyond comprehension

At some point when I was making my game, the camera just…
Gave up

I even tried disabling all scripts that change the camera in some form, and then the camera just decided to point to 0,0,0 with an offset of about 5,5,0.
When I try to change the camera type mwith the following script, it’s type DOES change, but it still behaves as if it was criptable type, i am absolutely baffled by this.
This script is supposed to change the camera type when the event is triggered

game.ReplicatedStorage.RemoteEvents.BlackoutEvent.OnClientEvent:Connect(function(GoingIntoRoom , CameraType)
	local randomangle = math.random(-8,8) * 45
	local TweenService = game:GetService("TweenService")
	local PartProperties = {BackgroundTransparency = 0}
	local TweenInfov = TweenInfo.new(
		0.32,
		Enum.EasingStyle.Linear,--EasingStyle
		Enum.EasingDirection.Out,--Easing direction
		0,--times to repeat
		false,--goes in reverse
		0--delay
	)

	local Tween = TweenService:Create(script.Parent,TweenInfov,{BackgroundTransparency = 0})
	Tween:Play()
	Tween.Completed:Wait()
	if GoingIntoRoom == true then
		game.Lighting.Atmosphere.Haze = 10
	else
		game.Lighting.Atmosphere.Haze = 0
	end
	print(CameraType)
	game.Workspace.CurrentCamera.CameraType = CameraType
	local Tween = TweenService:Create(script.Parent,TweenInfov,{BackgroundTransparency = 1})
	Tween:Play()
end)

And this one scripts the camera, and if im not mistaken, that should only work when the camera’s type is scriptable

--Get service needed for events used in this script
local RunService = game:GetService("RunService")	

-- Variables for the camera and player
local camera = workspace.CurrentCamera
local player = game.Players.LocalPlayer
player.CharacterAdded:Wait()
-- Constant variable used to set the camera’s offset from the player
local CAMERA_OFFSET = player.Character:WaitForChild("CameraOffset").Value
print(CAMERA_OFFSET)
camera.CameraType = Enum.CameraType.Custom

local function onRenderStep()
	-- Check the player's character has spawned
	if player.Character then
		local CAMERA_OFFSET = player.Character:WaitForChild("CameraOffset").Value
		local playerPosition = player.Character.HumanoidRootPart.Position
		local cameraPosition = playerPosition + CAMERA_OFFSET

		-- make the camera follow the player
		camera.CoordinateFrame = CFrame.new(cameraPosition, playerPosition)
	end
end
RunService:BindToRenderStep("Camera", Enum.RenderPriority.Camera.Value, onRenderStep)

help pls

Scriptable camera type just disables all other control. Every type of camera can by scripted with different effects. You will need to check in your onRenderStep function whether the camera type is scriptable.

1 Like

Well that actually worked! That was weird