Ok, so I figured out how to attach the camera to a block in studio mode, but in test mode, it sets the camera to fixed when I want it to set to attach.
In studio mode, it attaches just fine, but I can move the camera up and down. In test mode, it doesn't attach at all, it's still on fixed. I'm trying to use this script:
script.Parent.CameraSubject = workspace.Part workspace.Camera.CameraType = "Attach"
in order to set the camera to attach. But it's always fixed, it doesn't even give me an error so I don't know what's wrong. Once that problem is solved, I need to lock the camera at a certain angle so that the player can't move it. I can't find any settings/properties that allow the player to move the camera, so I can't turn disable movement. I would really appreciate some help with this, please!
I also need to make it so that the player can't zoom in or out, I need help with this as well as I cannot find settings/properties for this either.
It is most likely your placement of the script. Instead, try placing the script inside of a LocalScript, which should be inside StarterGui (for example).
Do repeat wait() until game.Players.LocalPlayer.Character
to wait for the character to load.
Next you'll want to get the camera, which is as simple as local cam = game.Workspace.CurrentCamera
. Now you can add what you've done, with some small modifications...
-- after the lines explained above cam.CameraSubject = game.Workspace.Part cam.CameraType = Enum.CameraType.Attach
Notice the use of an Enum instead of a string. Usually it ensures it'll work. Plus it gives you a neat list of options to look at.
To prevent it from moving, however, I'd do this:
cam.CameraSubject = game.Workspace.Part cam.CameraType = Enum.CameraType.Scriptable cam.CoordinateFrame = CFrame.new(game.Workspace.Part.Position)
This will make it look forward. To rotate it, you can make the last line cam.CoordinateFrame = CFrame.new(game.Workspace.Part.Position) * CFrame.Angles(-x in radians-, -y in radians-, -z in radians-)
OR you can add an argument to CFrame.new. This second argument will make the camera look towards that Vector3, so like cam.CoordinateFrame = CFrame.new(game.Workspace.Part.Position, -look at Vector3-)