<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [server](./server.md) &gt; [PlayerUI](./server.playerui.md) &gt; [lockPointer](./server.playerui.lockpointer.md)

## PlayerUI.lockPointer() method

Locks or unlocks the player's mouse pointer. If the pointer is unlocked with lockPointer(false), the player will not be able to use in-game inputs or camera controls from the mouse pointer until `player.ui.lockPointer(true)`<!-- -->, or in your game's client UI html with `hytopia.lockPointer(true)`<!-- -->.

**Signature:**

```typescript
lockPointer(lock: boolean): void;
```

## Parameters

<table><thead><tr><th>

Parameter


</th><th>

Type


</th><th>

Description


</th></tr></thead>
<tbody><tr><td>

lock


</td><td>

boolean


</td><td>

Set true to lock the pointer, false to unlock it.


</td></tr>
</tbody></table>
**Returns:**

void

