Quantcast
Channel: Unity Forum
Viewing all articles
Browse latest Browse all 1466670

I'm trying to adjust the mouse sensitivity of the First Person Controller using a slider in game.

$
0
0
Hello, I'm trying to adjust the mouse sensitivity of the First Person Controller using a slider in game. Here's the code I'm using:
Code (csharp):
  1. GUI.Label(Rect(550,260,100,40), "Mouse Sensitivity");
  2. GetComponent(MouseLook).sensitivityX = GetComponent(MouseLook).sensitivityY = GUI.HorizontalSlider(new Rect(0,0,200,50), GetComponent(MouseLook).sensitivityX, 1, 20);
Here's the error I'm getting:

Code (csharp):
  1. NullReferenceException: Object reference not set to an instance of an object...
I'm trying to adjust the mouse sensitivity of the First Person Controller using a slider in game.

Viewing all articles
Browse latest Browse all 1466670

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>