Everything works but when the BlackOut Frame goes away, the camera is just stuck wherever it was before, not the brick.
local cam = workspace.CurrentCamera local cartCameraBlock = workspace.Configuration.cartSelectorCam wait(5) for i = 1,0,-.05 do script.Parent.blackoutFrame.BackgroundTransparency = i wait() end repeat wait() cam.CameraType = Enum.CameraType.Scriptable until cam.CameraType == Enum.CameraType.Scriptable cam.CameraSubject = cartCameraBlock for i = 0,1,.05 do script.Parent.blackoutFrame.BackgroundTransparency = i wait() end
Whenever you set the CameraType
to Scriptable
, and then change the CameraSubject
to anything but a player's Character
, the camera will only be moved manually by changing it's CFrame, or by changing it's type again and setting the CameraSubject.
So with that said, a Scriptable
camera will NOT focus on the new CameraSubject
automatically. If you want this effect while in this mode, you must do the math and manually CFrame it to be so.
Otherwise, I recommend Enum.CameraType.Watch
, which does automatically focus on the set CameraSubject
.
cam.CameraType = Enum.CameraType.Watch cam.CameraSubject = cartCameraBlock
As a side note, there is no need for the following snippet to be in your code:
repeat wait() cam.CameraType = Enum.CameraType.Scriptable until cam.CameraType == Enum.CameraType.Scriptable
I am assuming you have that just because you didn't know how the Scriptable
type worked, and wanted to make sure it was set, however it is ultimately not useful to you.