Input
Last updated
Last updated
Reading player key inputs. Note that inputs are best handled in OnFrame rather than OnTick, due to being updated every frame and not every physics tick.
GetKeyName(key: string)
string
Gets the key name the player assigned to the key setting. Example: GetKeyName("General/Forward") will return the keybind at that setting. All input names can be found , with the file name being the category and the left-hand variable being the key name. For example, TitanInputSettings.cs contains the variable CoverNape, which can be referenced as "Titan/CoverNape".
GetKeyHold(key: string)
bool
Whether or not the key is being held down. Example: GetKey("Human/HookLeft")
GetKeyDown(key: string)
bool
Whether or not the key is first pressed this frame.
GetKeyUp(key: string)
bool
Whether or not the key is first released this frame.
GetMouseAim()
Vector3
Gets a Vector3 that represents the point the mouse pointer is aiming at. Note that this is not a direction but a world-space position of the closest object the mouse is aiming at.
GetMouseSpeed()
Vector3
Gets the user mouse speed.
GetMousePosition()
Vector3
Gets the user mouse position.
CursorAimDirection()
Vector3
Gets the direction ray of the cursor.
GetScreenDimensions()
Vector3
Gets the user screen dimensions.
SetKeyDefaultEnabled(key: string)
null
Whether or not keybind default behavior is enabled. If set to false, the keybind will not trigger the normal in-game action.
SetKeyHold(key: string)
null
Whether or not the keybind is simulated to be held. If set to true, the game will act as if the player is holding down the key.