# mousePosition

> The mouse position.

## Definition

* **Type:** Property
* **Namespace:** [UnityEngine](/engine/6000.5/script-reference/unityengine.md)
* **Assembly:** UnityEngine.IMGUIModule

```csharp
public Vector2 mousePosition { get; set; }
```

### Remarks

Used in [EventType.MouseMove](/engine/6000.5/script-reference/unityengine/eventtype/mousemove.md) and [EventType.MouseDrag](/engine/6000.5/script-reference/unityengine/eventtype/mousedrag.md) events.  The top-left of the window returns (0, 0).  The bottom-right returns (Screen.width, Screen.height).

Additional Resources: [Event.delta](/engine/6000.5/script-reference/unityengine/event/delta.md).

### Examples

```csharp
using UnityEngine;
using System.Collections;

// print the mousePosition every 10th of a second

public class ExampleClass : MonoBehaviour
{
    private float range = 0.0f;

    void OnGUI()
    {
        range = range + Time.deltaTime;

        if (range > 0.1f)
        {
            Event e = Event.current;
            Debug.Log(e.mousePosition);
            range = 0.0f;
        }
    }
}
```
