# x

> The X coordinate of the rectangle.

## Definition

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

```csharp
public float x { get; set; }
```

### Remarks

This value is the same as [Rect.xMin](/engine/6000.0/script-reference/unityengine/rect/xmin.md), but setting it will move the rectangle rather than resize it.

### Examples

```csharp
using UnityEngine;

public class RectExample : MonoBehaviour
{
    // Use this for initialization
    void Start()
    {
        Rect rect = new Rect(10, 10, 50, 30);
        Debug.Log("x = " + rect.x); // -- prints: x = 10
        rect.x = 20;
        Debug.Log(rect); // prints: (x:20, y:10, width:50, height:30)
    }
}
```
