GetAxisRaw

float GetAxisRaw(string description) float GetAxisRaw(int descriptionHash)

Parameters

description: The name of the axis, as defined in SetAxis(). descriptionHash: The hashcode of the name of the axis, as defined in SetAxis().

Returns

float: A value between -1 and 1 inclusive.

Description

Returns the value of the virtual axis identified by description or descriptionHash with no smoothing applied. In other words, sensitivity and gravity have no effect on this value.

The value will be in the range -1...1 for an axis made from analog (e.g., joysticks or gamepad triggers) inputs. Since input is not smoothed, an axis made from digital inputs (e.g., keyboard or gamepad buttons) will always be either -1, 0, or 1.

This is useful if you want to get the value of an axis before sensitivity or gravity smoothing is applied to it.

Example

Last updated