I've been making my game recently, And i added a Camera script. But i had a problem, I inserted the CamPart into a model (grouped it with other CamParts) and when i drag my mouse to the button, it turns into a black screen. It's grouped really.

local cam = workspace.CurrentCamera

script.Parent.MouseButton1Down:connect(function()
cam.CameraType = Enum.CameraType.Attach
cam.CameraSubject=workspace.CamPart

local Focus = game.Workspace.CurrentCamera.Focus * CFrame.new(0, 0, 0.05)
game.Workspace.CurrentCamera.CoordinateFrame = CFrame.new(Focus.p)
end)

1 comment

0

please edit the post and put your code in between the "~~~~~~ ~~~~~~"