In the script it is supposed to position the players camera to a Part named "CameraPart" and make the cameras type scriptable. This does not seem to work. Any help?
local cam = workspace:WaitForChild("Camera") local camp = workspace:WaitForChild("CameraPart") cam.CameraType = "Scriptable" cam.CameraSubject = workspace.CameraPart
So basically what you'll need to do is set the camera coordinate frame to the parts cframe as following:
local cam = workspace:WaitForChild("Camera") local camp = workspace:WaitForChild("CameraPart") cam.CameraType = "Scriptable" cam.CameraSubject = workspace.CameraPart cam.CoordinateFrame = camp.CFrame
LocalScript
local cam = workspace.CurrentCamera local camp = workspace:WaitForChild("CameraPart") cam.CameraType = Enum.CameraType.Scriptable cam.CameraSubject = camp cam.CFrame = camp.CFrame cam.FieldOfView = 70 -- This is optional
For a local player, you need to use the "CurrentCamera", which you cannot use :WaitForChild()
on (without creating an infinite yield)
Next, to prevent glitches, use the Enum of the CameraType rather than the string (even though it will work most times)
Finally, the camera's CFrame needs to match the part's CFrame so they are not too far away from each other, otherwise, the camera stays in place but changes its orientation only to match the CameraSubject