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

Can someone help me with camera manipulation?

Asked by 5 years ago

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

Log in to vote
0
Answered by
royaltoe 5144 Moderation Voter Community Moderator
5 years ago

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

0
let me know if you need more explanation/help royaltoe 5144 — 5y
Ad

Answer this question