Camera cframe not working

i am trying to set players camera cframe to parts cframe for some reason don’t work

local script:

local camera = workspace.Camera

local part = workspace.CameraPart

camera.CameraType = Enum.CameraType.Scriptable

camera.CFrame = part.CFrame
2 Likes

Try replacing workspace.Camera with workspace.CurrentCamera

2 Likes

You ran the code before the character spawned.
The camera properties were set, but after the character spawned they were overwriten.

Simplest fix:
Put the script into game.StarterPlayer.StarterCharacterScripts, this ensures the script was ran after the character has loaded.

Hope this helps!

3 Likes