- Home /
How to lower incriments on mouselook
Hi, everyone. I was wondering if there was a way to lower the move increments on the mouse look script. I would do it myself, but i only read js, not c#.
I'm working on an FPS and thought that the simplest way to make a sniper zoom would be to lower the feild of veiw(I thought of bringing it closer, but then the player wouldn't be able to see the enemeis that were very close to them). However, in the zoomed feild, it moves over about ten meters. I don't know what to do, because I thought that that was how avert fate did it, and I really like the way the player works in that game.
Thanks in Advance,
-Joe
Answer by Bampf · Mar 04, 2011 at 05:54 PM
(Note: for small edits like these, C# and Javascript just aren't that different. Don't be scared to read and make small changes to an existing C# script.)
MouseLook has two public member variables: sensitivityX, sensitivityY. By default they are set to 15.0. Changing those values should effect your mouse sensitivity. I believe making them lower is what you want while zoomed.
Now all you have to do is use new values while zoomed, and the original values while not zoomed. If you add that logic to the standard MouseLook script, you should probably save that as a new script rather than overwrite the standard one.
But you don't even have to edit the MouseLook script if you don't want. The sensitivity variables are public. So in your script that turns the zoom on and off, you could also set the MouseLook.sensitivityX and MouseLook.sensitivityY variables to new values. (Bonus: you get to stick with Javascript.)
Your answer
Follow this Question
Related Questions
The name 'Joystick' does not denote a valid type ('not found') 2 Answers
Error BCE0051: Operater '==' cannot be used. Please Help! 1 Answer
C# How to have weapon pickup 1 Answer
Issues with camera and player rotation scripts for basic FPS controller. 2 Answers
Camera Recoil,Please help me. 2 Answers