Issue with Camera when Player Joins

You can write your topic however you want, but you need to answer these questions:

  1. I want the players Camera to be set to a part when they join the game.

  2. At this point I don’t even know anymore because nothing I do seems to work, I’m trying to just set it So that when the player joins, their camera is set to the part but it remains on the player??

  3. I’ve tried local Scripts, Server scripts, Character added, and pretty much a whole ton of other things.

local CameraPart = workspace.CamPart

	cam.CameraType = Enum.CameraType.Scriptable
	cam.CFrame = CameraPart.CFrame

-- Tested this both on a Local Script and a Server Script both on PlayerScripts and CharacterScripts and ServerScriptService

do it in a local script, and do:

local CameraPart = workspace.CamPart

cam.CameraType = Enum.CameraType.Scriptable
cam.CFrame = CameraPart.CFrame

wait, sorry this is wrong im going to edit it now

this should set the cameras cframe to the parts cframe every frame, which i think is what you want.

I’ll test it out right now and I’ll let you know if it works.

Yeah, no it doesn’t work. I’m pretty sure there’s just something wrong with Roblox Studio or smth because I have tried for the last 3 months to fix this issue by myself watching countless YouTube videos yet none of them work no matter what I try to do.

that’s very strange, that code should work.

wait, add a task.wait(1) to the beginning of the script

Alright, that worked in a regular local script without me changing anything, I’ll try to implement it into my Game as a menu Camera, hopefully, that fixes it.

basically the problem was that it was checking for the part before you even loaded in 100%, so it didn’t see the part in the workspace

I wish the output could have provided more clarity on what it was that was causing the issue, because the only thing I saw when I tried doing it on my game was that the camera part wasn’t a child of the folder that the part was in which is extremely strange because it was parented to the folder… The camera is the thing I have trouble most with in Studio scripting, but thank you for the help!

you just need to :WaitForChild(“CamPart”) it’ll wait until it finds it