> For the complete documentation index, see [llms.txt](https://vopwn55.gitbook.io/powerlang-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://vopwn55.gitbook.io/powerlang-docs/libraries/services/mouse.md).

# Mouse

The Mouse service allows you to get information about the current player's mouse, such as current cursor position. Note that the functionality of this service can only be used on the client.

| **Function**                        | **Description**                                                                                                                                                              |
| ----------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `GetTargetPart() -> Instance?`      | Retrieves the part that the mouse is currently pointing at. Returns the `TargetPart` (Instance) that the mouse is hovering over.                                             |
| `GetTargetSurface() -> string`      | Retrieves the surface of the part that the mouse is currently pointing at. Returns the `Surface` (Enum.SurfaceType) the mouse is hovering over.                              |
| `GetPosition2D() -> number, number` | Gets the 2D position of the mouse on the screen. Returns `X` and `Y` coordinates of the mouse.                                                                               |
| `GetPosition3D() -> Vector3`        | Gets the 3D position of the mouse in the game world. Returns the `Position` (Vector3) where the mouse is pointing in the world.                                              |
| `SetTargetFilter(Object: Instance)` | Sets the object to be ignored when detecting mouse target parts. Takes 1 argument: `Object` (Instance), and sets it as a filter so the mouse ignores it in target detection. |
