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

Can someone help me with camera manipulation?

For some reason I just cannot figure out how to manipulate the camera and I would like some help figuring it out. Here are some of the things I would like to know

  1. How do manipulate the camera like change its position and stuff
  2. How do you lock the camera in a position where it will not be changed by player interaction (By player interaction I mean like the player dragging the mouse and stuff)

1 answer

✓ Accepted answer

How do you lock the camera in a position where it will not be changed by player interaction You can do this by setting the camera's cameratype property to scriptable:

camera = workspace.CurrentCamera
camera.CameraType = Enum.CameraType.Scriptable

How do manipulate the camera like change its position

You can change the camera's cframe/position by using camera's CFrame: The code below positions the camera to the cframe of a part in the workspace:

camera = workspace.CurrentCamera
camera.CameraType = Enum.CameraType.Scriptable

camera.CFrame = workspace.Part.CFrame

Make sure all of this is inside a localscript. I'd suggest putting it in StarterCharacterScripts so it gets ran everytime the player resets/loads into game

1 comment

0

let me know if you need more explanation/help

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