int SetAxis(string description, string negative, string positive, [float sensitivity], [float gravity], [float deadzone])
int SetAxis(string description, string action, [float sensitivity], [float gravity], [float deadzone])
description: The description of what the axis is used for.
action which provides the negative value of the axis.
action which provides the positive value of the axis.
sensitivity: Optional. The sensitivity for the axis. Defaults to
gravity: Optional. The gravity for the axis. Defaults to
deadzone: Optional. Input values below this level are ignored. Defaults to
int: The hashcode of
Creates an axis out of one or two
actions, which must have been set previously with
SetKey(). If two
actions are passed in, the first (
negative) will be used to provide the negative values while the second (
positive) will provide the positive values for the axis. If only one
action is passed in (
action) then the axis will only return positive values (unless inverted).
You can optionally override the default sensitivity, gravity, or deadzone of the axis by passing in
deadzone respectively. Additionally, you can use
SetAxisDeadzone() if you want to change these values for an axis after it has already been created.
Also note that setting up axes is not required and you should only do this if you require analog-like controls instead of digital controls. An axis input can be analog (e.g., joystick) or digital (e.g., keyboard button) or even a combination of the two. A virtual analog axis will be created if necessary. More details can be found in A Brief Explanation of cInput.