Camera manipulation working in studio but not working in the game

Hello I’m trying to make it so when the player joins the game the camera is stuck at one place but it is only working on studio and it is not working in Roblox Player

Roblox Studio:

Roblox Player:

On roblox player the camera is not getting stuck on the part and the camera type is also not becoming “Scriptable”

This is the script I’m using:

local player = game.Players.LocalPlayer
local character = player.Character or player.CharacterAdded:Wait()
local CamPart = workspace:WaitForChild("CamPart")
local camera = workspace.CurrentCamera

repeat 
	wait()
	camera.CameraType = Enum.CameraType.Scriptable
	camera.CFrame = CamPart.CFrame
until 
    camera.CameraType == Enum.CameraType.Scriptable and camera.CFrame == CamPart.CFrame



camera.CFrame = workspace.CamPart.CFrame
game.Lighting.Blur.Size = 12

It is a local script inside startergui
does anyone know how to fix this?

1 Like

It got fixed I just noticed that the “CamPart” was not anchored when i set it back to “anchored” it started working

1 Like

I have the same problem, But its all anchored and doesnt work