Changing Cameras position to a parts position

I am trying to change the players camera to the position of a part, but when the code runs the camera is behind the player but is still following the player.

local camera = workspace.CurrentCamera
camera.CameraType = Enum.CameraType.Scriptable
print(camera.CameraType)
wait(5)
camera.CFrame = CFrame.new(workspace.loadingCameraLocationPart.Position)   

try this-

local camera = workspace.CurrentCamera
canera.CameraType = Enum.CameraType.Scriptable
camera.CFrame = workspace.loadingCameraLocationPart.CFrame

That code should work, but if it doesn’t, try changing the first line to
local camera = game.Workspace:WaitForChild("CurrentCamera")

By Default, the Camera.CameraSubject is the player.
So the camera will follow the Player.
but if you want your camera to follow the part loadingCameraLocationpart instead of the player, then you’re going to set the camera.CameraSubject to the Part.
You might also see camera.CameraType if you don’t want the player being able to look arround.

2 Likes