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

How to lock the camera in place while allowing the mouse to be moved?

Asked by
8391ice 91
6 years ago
Edited 6 years ago

I wanna position the player's camera in such a way that it will always be locked to a part in the workspace without being able to turn or move, but I also want to allow for the mouse to move. This is for a menu type of level.

cam = game.Workspace.CurrentCamera
target = game.Workspace.IntroCamera --The part that the camera will be attached to

cam.CameraSubject = target
cam.CameraType = "Scriptable" --Setting it to scriptable so that the camera is still, however this causes the mouse to be unmovable
cam.CFrame = target.CFrame

So I've managed to make the camera locked to a part without the player able to turn it, but when I test it out, I can't move the mouse around, as it is locked to the center of the screen. How can I fix this?

0
Is the camera in first person mode? Amiaa16 3227 — 6y
0
don't let the player go in first person Leamir 3138 — 6y
0
That doesn't seem to be the issue. I added a bit of wait time before the camera is attached to the part so that I could make sure the player is zoomed out and the problem is still there. 8391ice 91 — 6y

Answer this question