# Cursor Lock (44599)

**URL:** https://discussions.unity.com/t/cursor-lock-44599/44599
**Category:** Questions & Answers
**Created:** [June 18, 2012, 1:05am UTC](https://discussions.unity.com/t/cursor-lock-44599/44599 "2012-06-18T01:05:53Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![Ampler\_Games](https://avatars.discourse-cdn.com/v4/letter/a/f14d63/32.png) [@Ampler\_Games](https://discussions.unity.com/u/Ampler_Games)
#### Post date: [June 18, 2012, 1:05am UTC](https://discussions.unity.com/t/cursor-lock-44599/44599/1 "2012-06-18T01:05:53Z")

</div>

I need my cursor to be locked and hiden when I start the game, and when I press the Esc key it will show the cursor and unlock it. Does anyone know how to do this?

---

<div class="post-metadata">

### Author: ![anon66389419](https://avatars.discourse-cdn.com/v4/letter/a/4da419/32.png) [@anon66389419](https://discussions.unity.com/u/anon66389419)
#### Post date: [June 18, 2012, 1:17am UTC](https://discussions.unity.com/t/cursor-lock-44599/44599/2 "2012-06-18T01:17:31Z")

</div>

Have a look at the Screen class provided by the product. Specifically it has two methods:

[Screen.showCursor](http://unity3d.com/support/documentation/ScriptReference/Screen-showCursor.html)

and

[Screen.lockCursor](http://unity3d.com/support/documentation/ScriptReference/Screen-lockCursor.html)
