Tuesday, April 4, 2017

Day 30: Audio-only Game, Post 5

Today I will be adding a mouse sensitivity slider. I found a tutorial for sliders that should help me.

First of all, I added a slider to my Settings panel.

In my 'camMouseLook' script, I added a variable that connects to the sensitivity, and will be changed by the slider. 

I then went to the inspector and changed the min and max values to 1 and 5 respectively. I also set the slider to only use whole numbers, for simplicity.

I then set the slider component to get the MouseSensitivity variable in the Main Camera's script and change it to the slider's value.

 Now the sensitivity can be changed by moving the slider.

Unfortunately, however, the camera still turns when moving the mouse. Next class I will add in a boolean (true/false) that is toggled when the "esc" button is pressed, which will also show/hide the menu.









No comments:

Post a Comment