cInput Reference Manual
CtrlK
  • Introduction
  • Using cInput
    • Initial Setup
    • A Brief Explanation of cInput
    • Setting Up the Default Inputs
      • The Keys Class
      • A Note About Xbox Controllers
      • Using Modifier Keys
    • Using cInput to Control Your Game
    • Changing Inputs from the Defaults
      • The OnKeyChanged Event
    • General Tips and Tricks
  • Script Reference
    • Variables and Properties
      • allowDuplicates
      • anyKey
      • anyKeyDown
      • deadzone
      • externalInputs
      • gravity
      • length
      • scanning
      • sensitivity
      • usePlayerPrefs
    • Methods
      • AddModifier
      • AxisInverted
      • Calibrate
      • ChangeKey
      • Clear
      • ForbidAxis
      • ForbidKey
      • GetAxis
      • GetAxisDeadzone
      • GetAxisGravity
      • GetAxisRaw
      • GetAxisSensitivity
      • GetButton
      • GetButtonDown
      • GetButtonUp
      • GetKey
      • GetKeyDown
      • GetKeyUp
      • GetText
      • Init
      • IsAxisDefined
      • IsKeyDefined
      • LoadExternal
      • RemoveModifier
      • ResetInputs
      • SetAxis
      • SetAxisDeadzone
      • SetAxisGravity
      • SetAxisSensitivity
      • SetKey
    • Valid Inputs
  • Changelog
Powered by GitBook
On this page
  • Parameters
  • Description
  • Example

Was this helpful?

  1. Script Reference
  2. Methods

SetAxisGravity

void SetAxisGravity(string axisName, float gravity) void SetAxisGravity(int axisHash, float gravity)

Parameters

axisName: The name of the axis you want to change the gravity value for. axisHash: The hashcode of the name of the axis you want to change the gravity value for. gravity: The value to assign as the gravity.

Description

Sets the gravity for the axis. This will override cInput's global gravity value.

This value can also be set during the initial axis creation using SetAxis().

Example

PreviousSetAxisDeadzoneNextSetAxisSensitivity

Last updated 6 years ago

Was this helpful?