Mouse Sensitivity Slider Control: Stumped by C#. Javascript?

Heya, Im looking for a way to use a gui slider to set the mouse sensitivity. If anyone has a snippet around maybe you’d share. I’d consider it a professional favor and would return it with some kind of art solution.

The bundled Mouselook is C# thus confusing.
Adapting the Mouselook plus from the wiki is also extra confusing.

If anyone has a clue, and wants something in exchange, let me know? -Because I dont have a clue, lol.

Thanks in advance
AC

Add this to the MouseLook script

	void OnGUI()
	{
		sensitivityX = sensitivityY = GUI.HorizontalSlider( new Rect(0,0,200,50), sensitivityX, 1, 20 );
	}

Thats great thanks.

Look me up when you need some art of some kind.

AaronC

Sorry to revive an old thread, but it seemed better than starting a new one.

Using the code posted above (thanks!) but it only seems to work for the X sensitivity. The Y sensitivity (up and down remains unaltered regardless of setting. Using the standard MouseLook script attached to the player object (set to mouse X) and its child main camera (set to mouseY).
Any ideas?

Do you mean you are using the standard script with the suggested modifications, or two different versions of the script or… ?

Ah this is what I’ve been looking for too in the hope it would compensate for some crazy magic mouse movement! :slight_smile: In my case this works on the up down movement but not left to right. This is on the standard FP controller prefab, so both cam and capsule are using the same script. Does it matter where this snippet is placed in the script?
TIA
boxy

If you don’t have an existing OnGUI function in the script then just add it in. Otherwise, add the active line from the function body to the existing OnGUI function somewhere.

Thanks Andeeee!
I subsequently realised just that. Another small step. :slight_smile:
Cheers

can anyone help me with my mouse sensitivity slider script? no seems to be helping me really need the help and would really appreciate it. GUI.horizontalslider and camera sensitivity script help - Unity Engine - Unity Discussions