# 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. |


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://vopwn55.gitbook.io/powerlang-docs/libraries/services/mouse.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
