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

How to lock camera FULLY ?

local target = workspace.Intro.Camz
local camera = workspace.CurrentCamera
local player = game.Players.LocalPlayer
camera.CameraSubject = target
local angle = 8

while wait() do 
	camera.CoordinateFrame = CFrame.new(target.Position)
								  * CFrame.Angles(0,angle,0)
							     * CFrame.new(0,0,-30)
angle = angle + math.rad(.3)

end

Basically lets the player move the camera a bit but not fully i want the camera to be locked fully so the right mouse holding has no effect Heres what i mean https://gfycat.com/FlickeringFrigidFlatfish

1 answer

All you really have to do is make the camera of type "Scriptable". This will prevent any user interaction from messing with the camera.

Here is wiki page on the CameraType property: http://wiki.roblox.com/index.php?title=API:Class/Camera/CameraType

You can find out about other camera types there.

In code it would simple work as:

camera.CameraType = "Scriptable" -- Or Enum.CameraType.Scriptable

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