Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
Tags

Scaling Mouse Sensitivity Behind the Scenes

A topic by jordanfb created Feb 04, 2020 Views: 336 Replies: 1
Viewing posts 1 to 2
(1 edit)

Hello!

Thanks so much for making this!

I used it for this past GGJ and it was super awesome -- easy to use and worked great.

The only issue I had with making my first person game was that the mouse sensitivity and joystick sensitivity were by default far different. Obviously you can scale the mouse from the rebinding menu, but I was wondering if there's a nice way to set the default mouse sensitivity to something far smaller to match joysticks (or vice versa) or a way to scale one or the other behind the scene (in addition to the scalar that's editable by the players).

What I ended up doing because I was making a hacky game jam game was on the first opening of the game I set the mouse sensitivity to .2 with Sinput.mouseSensitivity then I save the settings by calling the function your rebind menu calls on the apply settings button. Obviously this isn't a great solution although it worked for the game jam.

Is there a better way?

Thanks,

-Jordan

Developer

hi Jordan! Sorry I might not be much help right now as it’s been a while since I dug deep into the code but IIRC, Sinput.mouseSensitivity is a separate setting to what users can adjust in the rebind scene (I might be wrong though, but it should be easy enough for you to test with what you are doing now?)


I do know that you can (and in a few cases *should*) separate mouse and gamepad inputs for things like looking around, Sinput has a PrefersDeltaUse() function for this (check the “Framerate Independent Inputs” part of the documentation here) - generally, if this returns false then the input is from a mouse (on the frame you’re checking, if they switch to a gamepad stick it will become true), and you can multiply the input by your own scaling factor within a conditional.


I hope this is some help! If not let me know and I can try digging through the code for a refresher so I can give a better answer :)