Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How do you make a locked-camera script?

I want a script to lock the players view to a camera inside of a part that is aimed towards a soccer field I made as a part of my GUI menu.

Cam = workspace.CurrentCamera
Cam.CameraType = Enum.CameraType.Scriptable
Target = workspace.CameraPart
Position = Target.Position
Cam.CameraSubject = Target
Angle = 0
Cam.CoordinateFrame = Target.CFrame

CameraPart is the part I want the camera to look from. CameraMenu is the localscript.

1 answer

I recently remembered how to use Camera Manipulation, so I think I can help you out. So, I believe this is how your script should go. (Don't forget, put this in a LocalScript in your StarterGui for the base of what I'm telling you.)

Target = game.Workspace.CameraPart *(Do not do "workspace", use "game.Workspace")*
local cam = game.Workspace.CurrentCamera
cam.CameraType = Enum.CameraType.Scriptable
cam.CameraSubject = Target
angle = 0
while wait() do
	cam.CoordinateFrame = CFrame.new(Target.Position)
end

4 comments

0

That should work, tell me if it doesn't and I'll try to help more.

0

And if it does, just edit it to what you want. If it breaks from that, tell me.

0

Not working. . .

0

Strange, it should definitely be working. I tested it in studio. You got rid of my note right?

This discussion is preserved as it was. New answers, comments, and votes are closed.