Does Unity have built-in support for inverting input axes at runtime?

I’m trying to provide the common ‘Invert Mouse Y-axis’ functionality to users. I can do this by simply maintaining a boolean somewhere, toggling it when a user clicks a UI element, and then multiplying the output of Input.GetAxis("Mouse Y") by -1 when the boolean flag is set.

However, since the Input Manager in Unity has an Invert checkbox for inputs, I’m wondering whether Unity also supports a built-in way to invert an axis at runtime. I was hoping to be able to call something like Input.SetAxisInverted("Mouse Y", true), but I can’t find anything along those lines in the documentation for Input, so I’d like to know if there’s anything I’ve missed, or whether I’ll have to provide my own system.

1 Answer

1

no, you need to build it over input, actually it’s not very good idea to use input directly

Ah well, I suppose I'll do that, then.

–