Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Scriptable CameraType immediately switches to custom?

-- Roblox Services
local Workspace = game:GetService("Workspace")


-- Variables

local camera = Workspace.CurrentCamera
local cameraType = camera.CameraType
local cameraCframe = camera.CFrame

local classroom = script.Parent
local cameraPositioniongPart = classroom:WaitForChild("CameraPositioningPart")

local normal = Enum.CameraType.Custom
local scriptable = Enum.CameraType.Scriptable

cameraType = scriptable

print(cameraType)

cameraCframe = cameraPositioniongPart.CFrame

The weird thing is, the print statement says that the CameraType is scriptable, but when I print the CameraType in the command bar, it prints Custom.

1 answer

✓ Accepted answer

When your character is loaded it instantly changes it to Custom. Also, make sure that script is LocalScript inside the StarterGui

Here is a probably working script:

wait(0.25)

-- Variables

local camera = workspace.CurrentCamera
local cameraType = camera.CameraType
local cameraCframe = camera.CFrame

local classroom = script.Parent
local cameraPositioniongPart = classroom:WaitForChild("CameraPositioningPart")

local normal = Enum.CameraType.Custom
local scriptable = Enum.CameraType.Scriptable

cameraType = scriptable

print(cameraType)

cameraCframe = cameraPositioniongPart.CFrame

Hope this helps! :D

This discussion is preserved as it was. New answers, comments, and votes are closed.