generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Re: Tutorial: Mouse Smoothing in Shooter Games

Previous Thread :: Next Thread 
KittehCatten is not online. KittehCatten
Joined: 22 Jul 2012
Total Posts: 509
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
ClassicalGod is not online. ClassicalGod
Joined: 26 Sep 2008
Total Posts: 2842
02 Sep 2016 07:53 AM
ok
Report Abuse
Paratide is not online. 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
KittehCatten is not online. KittehCatten
Joined: 22 Jul 2012
Total Posts: 509
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
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image