|
| 02 Sep 2016 07:51 AM |
First, create a local script to handle all camera movement. Second, have the local script create a part to use as a point of reference for the camera. Third, create a Heartbeat loop that refreshes the position of the camera to the position of the reference part, and the reference part to the position of the head (Or over the shoulder, for Third Person Shooter games.) Make sure the loop refreshes the camera's horizontal rotation, and changes the vertical rotation based on a value, which I shall explain later. Fourth, set the CameraMode to LockFirstPerson in StarterPlayer. Fifth, create an InputChanged() listener with an "if input.UserInputType == Enum.UserInputType.MouseMovement then" statement. Sixth, rotate the player's torso horizontally based on the mouse's delta's X. Seventh, create a value that changes based on the mouse's delta's Y. This value is what you use to determine the camera reference part's vertical rotation in the camera refresh heartbeat loop. Eighth, in the two previously made loops, divide the delta's X and Y by a number between 3000 and 6000. You can tie this number to UserSettings().GameSettings.MouseSensitivity if you want. Ninth, bugtest.
|
|
|
| Report Abuse |
|
| |
Paratide
|
  |
| Joined: 01 Sep 2016 |
| Total Posts: 103 |
|
|
| 02 Sep 2016 07:57 AM |
Show a finished product please or describe what mouse smoothing means?
|
|
|
| Report Abuse |
|
|
| 02 Sep 2016 08:01 AM |
You know how, in the default Roblox camera script, if you're in first person, the mouse's DPI is extremely low, regardless of your mouse's actual DPI? And how your mouse's DPI seems to become even lower when your field of view becomes smaller? This solves that problem.
|
|
|
| Report Abuse |
|