> For the complete documentation index, see [llms.txt](https://espergames.gitbook.io/animatables/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://espergames.gitbook.io/animatables/scripting-basics/creating-animations/animating-rect-transform.md).

# Animating Rect Transform

RectTransform animation scripting examples.

## Position

#### Move AB

```csharp
// Move from (0, 0, 0) to (0, 600, 0) in 1 second
rectTransform.Move(Vector3.zero, new Vector3(0, 600), 1);
```

#### Move Array

```csharp
// Move through all points in 1 second
rectTransform.Move(new Vector3[] { Vector3.zero, new Vector3(0, 600), Vector3.zero }, 1);
```

## Rotation

#### Rotate AB

```csharp
// Rotate from (0, 0, 0) to (0, 0, 45) in 1 second
rectTransform.Rotate(Vector3.zero, new Vector3(0, 0, 45), 1);
```

#### Rotate Array

```csharp
// Rotate through all points in 1 second
rectTransform.Rotate(new Vector3[] { Vector3.zero, new Vector3(0, 0, 45), Vector3.zero }, 1);
```

## Resize

The RectTransform.Resize method takes a Boolean parameter called `useScale` that, when false, will resize the RectTransform's width and height. If true, it will resize the scale instead.

#### Resize AB

```csharp
// Resize from (0, 0) to (100, 100) in 1 second (using width and height)
rectTransform.Resize(Vector3.zero, new Vector3(100, 100), 1, false);
```

#### Resize Array

```csharp
// Resize through all points in 1 second (using scale)
rectTransform.Resize(new Vector3[] { Vector3.zero, Vector3.one, Vector3.zero }, 1, true);
```
