I am aware that you can use LockFirstPerson for such things, but what i am wanting to do is lock the mouse to the middle of the screen, while the cameratype is Scriptable. The problem with setting the CameraType to custom and back is that it positions the camera back into a 20 stud distance from the focus of the camera, and setting the focus of the camera does not seem to work.
I am not trying to create a 3rd person camera, rather a completly custom camera.
This is not a valid answer. I am not trying to create a fake mouse, what i am attempting to do is create a custom camera. Creating a fake mouse in the middle of the screen would not help for this, since im trying to make the rotation for it.
I have a while loop checking how much distance the mouse has passed over, then it turns the camera that amount.
But after the mouse gets to the edge of the screen, it starts messing things up, though it still rotates, it ends up with the mouse far off the screen, making it impossible to click anything.
I cannot post in comments yet, because i do not have 10 reputation.
What you can do is create a "fake" mouse cursor in the center of the screen, using a simple GUI and making the mouse's Icon an invisible image.
To get this mouse's target, simply use a Raycast from the camera's CFrame directed at its lookVector.
I understand and this is indeed possible now.We will use the UserInput service in a local script to set the Enum in the center so we do Game:GetService("UserInputService").MouseBehavior = Enum.MouseBehavior.LockCenter by playing with its MouseBehavior property we can set the Enum to LockCenter for it to stay in that position hope this helps.Farewell