# setCursorPosition (Client)

> Moves the cursor to a point on the screen.

- **Platform**: MY Multiplayer (MYMP)
- **Kind**: Lua Function
- **Side**: Client
- **Category**: Keyboard
- **URL**: https://wiki.mymp.gg/en/setCursorPosition

## Syntax

```lua
bool setCursorPosition(float x, y)
```

## Parameters

| Name | Type | Description |
| --- | --- | --- |
| `x, y` | `float` | Position in pixels, or a vec2. Values off the screen are clamped to its edge. |

## Returns

`true` when the move was requested.

## Example

```lua
local width, height = getScreenSize()
showCursor(true)
setCursorPosition(width / 2, height / 2)
```

## See also

- [getCursorPosition (Client)](https://wiki.mymp.gg/en/getCursorPosition.md): Reads where the cursor is on the screen and the world point it points at.
- [showCursor (Client)](https://wiki.mymp.gg/en/showCursor.md): Shows or hides the mouse cursor for this resource.
