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


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


float: A value between -1 and 1 inclusive.


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.


// move the transform horizontally with the "Horizontal Movement" axis transform.Translate(cInput.GetAxisRaw("Horizontal Movement"), 0, 0);

results matching ""

    No results matching ""