getmouse
Returns the local player Mouse userdata.
Syntax
getmouse() -> Mouse
Parameters
This function takes no parameters.
Returns
| Type | Description |
|---|---|
Mouse | Mouse userdata for the local player. |
Description
This is the same userdata returned by LocalPlayer:GetMouse(). The VM currently exposes X and Y in client-space coordinates.
Example
local mouse = getmouse()
print(mouse.X, mouse.Y)
Notes
Hit,TargetandUnitRayare not exposed yet.- The function returns a Mouse object even when the game is not attached; X and Y still follow the cursor.