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

Help? Camera Lock?

-- in a LocalScript
local camera = game.Workspace.CurrentCamera
camera.CameraSubject = game.Workspace["Korblox & Overseer & Redcliff Models"].Sparks

script.Parent["Intro Gui"]["Main Frame"]["Play Game Button"].MouseButton1Click:connect(function(playerCamera)
	game.Workspace.CurrentCamera.CameraSubject = game.Players.LocalPlayer.Character.Humanoid
	game.Workspace.CurrentCamera.CameraType = "Custom"
end)

Is there a way to lock the camera so that the player cannot move it around with the right mouse button?

1 comment

0

Try using LockFirstPerson, the setting the subject

2 answers

Use "Scriptable" as your camera type.

Do

-- in a LocalScript
local camera = game.Workspace.CurrentCamera
camera.CameraSubject = game.Workspace["Korblox & Overseer & Redcliff Models"].Sparks

script.Parent["Intro Gui"]["Main Frame"]["Play Game Button"].MouseButton1Click:connect(function(playerCamera)
    game.Workspace.CurrentCamera.CameraSubject = game.Players.LocalPlayer.Character.Humanoid
    game.Workspace.CurrentCamera.CameraType = "Scriptable"
end)

instead of

-- in a LocalScript
local camera = game.Workspace.CurrentCamera
camera.CameraSubject = game.Workspace["Korblox & Overseer & Redcliff Models"].Sparks

script.Parent["Intro Gui"]["Main Frame"]["Play Game Button"].MouseButton1Click:connect(function(playerCamera)
    game.Workspace.CurrentCamera.CameraSubject = game.Players.LocalPlayer.Character.Humanoid
    game.Workspace.CurrentCamera.CameraType = "Custom"
end)

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