Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How do you make a locked-camera script?

Asked by 8 years ago

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

Log in to vote
0
Answered by 8 years ago

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
0
That should work, tell me if it doesn't and I'll try to help more. ZaltherusKenobi 15 — 8y
0
And if it does, just edit it to what you want. If it breaks from that, tell me. ZaltherusKenobi 15 — 8y
0
Not working. . . User#4422 0 — 8y
0
Strange, it should definitely be working. I tested it in studio. You got rid of my note right? ZaltherusKenobi 15 — 8y
Ad

Answer this question