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.