I was testing how to change the camera and I came across this problem

game.Players.PlayerAdded:Connect(function(plr)
	plr.CharacterAdded:Connect(function(char)
	wait(5)
	game.Workspace.CurrentCamera.CameraSubject = game.Workspace.Part
	print("Camera changed")
	end)
end)

It prints Camera changed but doesn't change the camera. Edit: found out the problem by myself. I needed to change the CFrame and make the camera scriptable. Final script:

local player = game.Players.LocalPlayer
local camera = workspace.CurrentCamera
local char = player.Character or player.CharacterAdded:Wait()
repeat
	wait()
camera.CameraType = Enum.CameraType.Scriptable
until camera.CameraType == Enum.CameraType.Scriptable
camera.CFrame = workspace.CameraPart.CFrame

3 comments

0

You have to adjust the CoordinateFrame and set the CameraType.

0

Where can I find CoordinateFrame property?

0

Try making the part in the workspace more obvious e.g.: game.Workspace.CameraPart