So, I'm making a menu gui and I want a camera to look at a certain hallway. I want it to be type scriptable so users cant pan the camera, but I'm running into multiple issues.
local target = workspace.CameraPart local camera = workspace.CurrentCamera camera.CameraType = Enum.CameraType.Scriptable camera.CameraSubject = target
Any help would be amazing. Thanks!
Simple problem, I had trouble with it once too. Here's what you do:
local target = workspace.CameraPart local camera = workspace.CurrentCamera camera.CameraType = Enum.CameraType.Scriptable camera.CoordinateFrame = target.CFrame
The "Scriptable" CameraType does not work with CameraSubject. You need to use the CoordinateFrame property instead. CFrame is short for CoordinateFrame. So instead of using camera.CameraSubject use camera.CoordinateFrame and instead of putting "target" or the subject you want, use target.CFrame. If you want to edit the positions with it, do this:
local target = workspace.CameraPart local camera = workspace.CurrentCamera camera.CameraType = Enum.CameraType.Scriptable camera.CoordinateFrame = CFrame.new(target.CFrame.X + number,target.CFrame.Y + number,target.CFrame.Z + number)
edit the "number"s to what you want.