Input Functions
Functions for simulating mouse input and controlling the game cursor via global functions and the Input singleton.
Input (Singleton)
The Input object provides access to hardware state and mouse position in world space.
mouse_move (Global)
Moves the cursor to absolute screen coordinates.
| Lua | |
|---|---|
Parameters:
- x (number): X coordinate
- y (number): Y coordinate
Example:
mouse_get_position (Global)
Gets the current cursor position as a string.
| Lua | |
|---|---|
Returns: String in format "x,y"
mouse_click (Global)
Simulates a full mouse click (press + release).
| Lua | |
|---|---|
Parameters:
- button (number): Mouse button (0=left, 1=right, 2=middle)
mouse_scroll (Global)
Simulates mouse scroll wheel movement.
| Lua | |
|---|---|
Parameters:
- amount (number): Scroll amount (positive=up, negative=down)
Example:
mouse_lock (Global)
Locks or unlocks the Unity cursor.
| Lua | |
|---|---|
Parameters:
- locked (number):
- 1 = Lock cursor
- 0 = Unlock cursor
mouse_visible (Global)
Shows or hides the Unity cursor.
| Lua | |
|---|---|
Parameters:
- visible (number):
- 1 = Show cursor
- 0 = Hide cursor