So i want to make something in my game that your camera isn't focused on the player. This is what i tried:
game.Workspace.CurrentCamera = game.Workspace.CamPart game.Workspace.Camera.CameraType = Enum.CameraType.Scriptable
That whole script apparently didn't work,
Including the:
game.Workspace.Camera.CameraType = Enum.CameraType.Scriptable
part.
Well, the thing is i don't know if it actually worked, but when i ran the game, the script popped up and had a little arrow pointing to the line of code, (at the very top, the first line) and i hovered my mouse over it and it said:
Error: Bad call
How come? If you have an answer, you know what to do.
I think you're trying to change the cameras CoordinateFrame.
This will change the cameras position to the parts CFrame:
--LocalScript workspace.CurrentCamera.CoordinateFrame = workspace.CamPart.CFrame
The camera will face towards the front surface of the part it is being attatched to. Now lets add a RenderStepped function:
--LocalScript game:GetService("RunService").RenderStepped:connect(function() workspace.CurrentCamera.CoordinateFrame = workspace.CamPart.CFrame end)
RenderStepped is to continually attatch the camera to that part. Without it, the cameras CoordinateFrame will only be attatched once and will be able to move freely afterwards.
Please upvote if helped!