Camera Script not working

Hello

I made this menu and it requires to move the player’s camera
I put the player’s camera into a a part by:

while wait() do
	game.Workspace.CurrentCamera.CFrame = game.Workspace.CameraPart.CFrame
	game.Workspace.CurrentCamera.CameraType = Enum.CameraType.Scriptable
	game.Workspace.CurrentCamera.FieldOfView = 40
end

it did work but I cannot click any ClickDetectors
is there anyway to fix this?

put the cameratype line outsife if the while loop and as far as ive known you dont need a while loop but make sure the cameratype line should always be the most highest line

The camera didn’t stuck into the CameraPart’s CFrame
but instead it goes back to the player and also got a warning

ActivateCameraController did not select a module.

try this

local cam = workspace.CurrentCamera
local CameraPart=workspace.CameraPart
cam.CameraType=Enum.CameraType.Scriptable
cam.CFrame = CameraPart.CFrame
cam.FieldOfView = 40

It has the same result as the last one but now I can rotate my camera
also the FOV is working fine

try this maybe

workspace.CurrentCamera.CameraSubject=worspace.CameraPart
worspace.CurrentCamera.FiedlOfView = 40

if didnt work then try this

workspace.CurrentCamera.CameraType=Enum.CameraType.Custom
workspace.CurrentCamera.CameraSubject=worspace.CameraPart
worspace.CurrentCamera.FiedlOfView = 40

wait it worked the script you replied
when I move it to the StarterCharacterScript
but I haven’t check when I can click it with a ClickDetector
I have been parenting my camera script in the starter pack
I didn’t know

or try this

workspace.CurrentCamera.CameraType=Enum.CameraType.Custom
workspace.CurrentCamera.CFrame=workspace.CameraPart.CFrame
worspace.CurrentCamera.FiedlOfView = 40

so it worked you mean?? if its nice job finding solution

sadly I can’t click a click detector :pensive:

try three new scripts i gave also this should be in a LocalScript

the three scripts did not work and also I put it in local script
I was thinking on boxing the player instead and lock it in a
first person and also forcing it to look forward but I don’t know
how to force the player to look forward

I’m gonna check in yt if there’s any solution

also are you trying to make the player camera stuck in the camerapart as sooon the palyer joins and it stays forever

yes I was making it a separate game the menu(Game1)
and when the player clicks the play the player will be tp to the second game(Lobby)

i guess i know what to do maybe try making the spawn point near the click detector i think the click detector doesnt work if the player is far away from click detector and also use this script

local cam = workspace.CurrentCamera
local CameraPart=workspace.CameraPart
cam.CameraType=Enum.CameraType.Scriptable
cam.CFrame = CameraPart.CFrame
cam.FieldOfView = 40

make sure its a local script and its name is CameraScript with the capitalisation and also make sure follow the name exactly and put the script inside StarterPlayerScripts

the camera worked I figure it out I increase the MaxDistance and I put the player near the button