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

How do I make it so my camera can't move?

When a player, joins, this localscript is put into their backpack

cam = game.Workspace.CurrentCamera

cam.CameraSubject = game.Workspace.Focus
cam.CameraType = "Attach"

This works, but how would I make it so you can't move the camera up, down, left, right and you cant zoom in or out? Attach is the closest to that. Thanks for all help :)

3 comments

0

Make the cameraType Scriptable

0

Well, I figured, but I am not that into scripting cameras, so I don't know how I would script how I want it

0

I would say make it Fixed unless you want to script some behavior later, http://wiki.roblox.com/index.php?title=API:Enum/CameraType

2 answers

✓ Accepted answer
local cam = game.Workspace.CurrentCamera

cam.CameraType = "Scriptable"
cam.CFrame = CFrame.new(pos1,pos2)
 -- Pos1 is the position of the camera (Where do you want it to be)
 -- Pos2 is the position of where the camera is looking at

Try this. =]

local cam = game.Workspace.CurrentCamera

cam.CameraSubject = game.Workspace.Focus
cam.CameraType = "Attach"
wait(.1)
cam.CameraType = "Scriptable"
cam.FieldOfView = 70

1 comment

1

What? Why did you use a wait to change the cameraType more than once? Just set it to Scriptable before the wait. Using unnecessary waits are ugly.  

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