# Problem with the Input.mousePosition

**URL:** https://discussions.unity.com/t/problem-with-the-input-mouseposition/661129
**Category:** 2D
**Tags:** 2D
**Created:** [April 10, 2017, 9:54am UTC](https://discussions.unity.com/t/problem-with-the-input-mouseposition/661129 "2017-04-10T09:54:51Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![Tiranex](https://avatars.discourse-cdn.com/v4/letter/t/77aa72/32.png) [@Tiranex](https://discussions.unity.com/u/Tiranex)
#### Post date: [April 10, 2017, 9:54am UTC](https://discussions.unity.com/t/problem-with-the-input-mouseposition/661129/1 "2017-04-10T09:54:51Z")

</div>

I’m trying to move an object about the x-axis of the mouse, the code I have for now is this:

```csharp
transform.position = new Vector3(Mathf.Clamp(Camera.main.ScreenToWorldPoint(Input.mousePosition).x, MinMovement, MaxMovement), transform.position.y, transform.position.z);

```

The problem is that when converting from pixels to Unity world units, it always gives me the position of the camera and I want the position of the mouse already converted to Unity world units.

Does anyone know how to fix it?

---

<div class="post-metadata">

### Author: ![LiterallyJeff](https://dub1.discourse-cdn.com/unity/user_avatar/discussions.unity.com/literallyjeff/32/900755_2.png) [@LiterallyJeff](https://discussions.unity.com/u/LiterallyJeff)
#### Post date: [April 11, 2017, 2:25pm UTC](https://discussions.unity.com/t/problem-with-the-input-mouseposition/661129/2 "2017-04-11T14:25:57Z")

</div>

Do you have your Min/MaxMovement set to something other than zero?
