Yuari
Documentation
Docs/Services/UserInputService.GetMouseLocation

UserInputService.GetMouseLocation

Cursor position in client space.

Syntax

UserInputService.GetMouseLocation() -> Vector2

Parameters

This function takes no parameters.

Returns

TypeDescription
Vector2Vector2

Description

UserInputService.GetMouseLocation is part of the Services library. Service shims are pumped by the external tick loop and expose the parts of Roblox services the VM supports.

The call is read-only: it resolves the current value when invoked and does not change the underlying state.

Example

local mouse = UserInputService.GetMouseLocation()
print(mouse.X, mouse.Y)

Notes

  • Service signals are pumped by the external tick loop.