- Home /
Change mouse sensitivity with slider
hi , What i am trying to do is LOWER my Current X AND Y mouse look sensitivity when i change the hoirzontal GUI slider left or right . i have some code set up , but nothing sees to be working - Oh i am working with Javascript aswell
Slider script snippet :
static var Msensitivity : float = 250;
Msensitivity = GUI.HorizontalSlider (Rect (430, 145, 400, 25), Msensitivity, 50, 400);
GetComponent("FPSMouseLook").sensitivityX = Msensitivity;
Mouse Look script :
ublic enum RotationAxis {MouseX = 0, MouseY = 1}
var RotationAxisRotationXY = RotationAxis.MouseX || RotationAxis.MouseY;
var sensitivityX : float = 400f;
var minimumX : float = -360f;
var maximumY : float = 360f;
var RotationX : float = 0f;
var OriginalRotation : Quaternion;
var RotationY : float = 0f;
var minimumY : float = -360;
var maximum : float = 360f;
var sensitivityY : float = 400f;
function Update () {
if( RotationAxisRotationXY == RotationAxis.MouseX){
RotationX += Input.GetAxis("Mouse X") * sensitivityX * Time.deltaTime;
OriginalRotation = XQuaternion = Quaternion.AngleAxis (RotationX , Vector3.up);
transform.localRotation = OriginalRotation * XQuaternion;
}
}
Yes , i know i can only move on the X - Axis but i will add the Y right now or soon , and add the same code ( The one you guys give me :D ) and make it on the Y instead . Thank you for your time !
hey robertbu , it just says $$anonymous$$ouse Look script : .... and then nothing ... should i put something there?
Your answer
Follow this Question
Related Questions
GUI slider and rotation not working 1 Answer
move object with slider 1 Answer
C# code is making 0.0 a double and not a float 3 Answers
create custom Horizontal slider 2 Answers
Horizontal Slider issue 0 Answers