Search Unity

Feedback [Feature Request]Make the Input Project Settings editable via C#

Discussion in 'Scripting' started by PrinterCode, Sep 2, 2019.

  1. PrinterCode

    PrinterCode

    Joined:
    Sep 2, 2019
    Posts:
    1
    This is a very little feature, but I would love it if a feature was added to unity that would make input project settings sensitivity editable by C#.
    Recently, I wanted to add adjustable mouse sensitivity to my game, but I used 'Input.GetAxis("Mouse X")' and 'Input.GetAxis("Mouse Y")' so many times that I would have to dig though many of my scripts and add '*sensitivity' to the end of each of those, which I did and it took quite some time. Because of this, I would love it if you could edit the input sensitivity though code like you could though the project settings. It would have saved lots of my time and would simplify adding adjustable mouse sensitivity in unity. Another thing that would be useful about this feature is that it would allow you set the input sensitivity to 0 for a certain axis or just being able to disable that input axis and enable it again by setting to 1 or something. Previously, I ran into an issue. The issue was that I didn't want the mouse to be able to make the player look around while the inventory menu was open. So I researched how to set the input projects settings sensitivity for the mouse X and mouse Y axis to 0, and I found out it wasn't possible. What I did was I set the sensitivity variable that I made to 0 whenever the inventory menu was open. But I also had to do the same with the horizontal axis to make sure that you couldn't move while the inventory was open, which took more time. Then finally, I got the player to not be able to move while the inventory was open, and I got the mouse to not get the player to look around while the inventory was open. If this feature existed, I could've simply changed the input settings sensitivity instead of adding the '*sensitivity' to every 'Input.GetAxis("Mouse X")' or 'Input.GetAxis("Mouse Y")' in my code. I could have also been able to easily disable axises by setting their sensitivity to 0, instead of setting the Horizontal, Mouse X, and Mouse Y sensitivity variable that I created to zero.

    So I think this would just save time with axis sensitivity. It would've made a big difference if this feature existed while I ran into the issues I ran into.
     
  2. I seriously doubt that with the new input system just around the corner they would make any improvement on the old system.
    https://forum.unity.com/forums/new-input-system.103/

    Please do not open multiple threads about the same problem/question.