Custom Maps & Logic
  • Custom Map Tutorial
    • Custom Map Introduction
    • Your first map
    • Map Navigation
    • Object Selection
    • Object Positioning
    • Object Attributes
    • Shortcuts and Macros
    • Editor Settings
    • Built-in Components Common Errors
    • Map Performance
    • Custom Assets
      • Your first Asset Bundle
      • Asset Bundles in Map Editor
      • Asset Bundles in Game
      • Adding to Asset Bundles
      • Asset Bundle naming
  • Custom Logic Tutorial
    • Custom Logic Introduction
    • Your first script
    • Variables
    • Types
    • Variable Inspector
    • Expressions
    • Conditionals
    • Loops
    • Functions
    • Coroutines
    • Classes
    • Static Classes
    • Components
    • Extensions
    • Cutscenes
    • Static Objects
    • Networking
    • Commenting
  • Reference
    • Static Classes
      • Game
      • Network
      • Map
      • UI
      • Time
      • Convert
      • String
      • Input
      • Math
      • Random
      • Cutscene
      • Camera
      • RoomData
      • PersistentData
      • Json
      • Physics
    • Objects
      • Component
      • Object
      • Character
      • Human
      • Titan
      • Shifter
      • MapObject
      • Transform
      • Player
      • NetworkView
      • Color
      • Vector3
      • Quaternion
      • Dict
      • List
      • Range
      • LineCastHitResult
      • MapTargetable
      • Random
    • Callbacks
      • Main
      • Components
  • Examples
    • Gamemodes
      • Survive
      • Waves
      • Endless
      • Racing
      • Blade PVP
      • Thunderspear PVP
      • Titan Explode
      • Cranked
      • More Examples
    • Components
      • SupplyStation
      • Daylight
      • PointLight
      • Rigidbody
      • NavMeshObstacle
      • Cannon
      • Dummy
      • Wagon
      • Tag
      • KillRegion
      • DamageRegion
      • MovePingPong
      • RacingCheckpointRegion
      • RacingFinishRegion
      • TeleportRegion
      • Animal
      • SignalMover
      • SignalSender
      • More Examples
Powered by GitBook
On this page
  1. Reference
  2. Static Classes

Input

PreviousStringNextMath

Last updated 5 months ago

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.

Function
Returns
Description

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.

Here