# Scale

> Creates a scaling matrix.

## Definition

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

## Scale(Vector3)

Creates a scaling matrix.

```csharp
public static Matrix4x4 Scale(Vector3 vector)
```

### Parameters

**** (\[Vector3]\(/engine/6000.7/script-reference/unityengine/vector3)):&#x20;

### Returns

| Type                                                                  | Description |
| --------------------------------------------------------------------- | ----------- |
| [Matrix4x4](/engine/6000.7/script-reference/unityengine/matrix4x4.md) |             |

### Remarks

Returned matrix is such that scales along coordinate axes by a vector `v`. The matrix looks like this:

```csharp
using UnityEngine;

public class ExampleScript : MonoBehaviour
{
    void Start()
    {
        Vector3 scale = new Vector3(1, 2, 1);
        Matrix4x4 scaleMatrix = Matrix4x4.Scale(scale);

        Debug.Log(scaleMatrix);
    }
}
```

Additional Resources: [Matrix4x4.TRS](/engine/6000.7/script-reference/unityengine/matrix4x4/trs.md), [Matrix4x4.Rotate](/engine/6000.7/script-reference/unityengine/matrix4x4/rotate.md), [Matrix4x4.Translate](/engine/6000.7/script-reference/unityengine/matrix4x4/translate.md), [Matrix4x4.SetTRS](/engine/6000.7/script-reference/unityengine/matrix4x4/settrs.md) functions.

## Scale(Vector3)

Creates a scaling matrix.

```csharp
public static Matrix4x4 Scale(in Vector3 vector)
```

### Parameters

**** (\[Vector3]\(/engine/6000.7/script-reference/unityengine/vector3)):&#x20;

### Returns

| Type                                                                  | Description |
| --------------------------------------------------------------------- | ----------- |
| [Matrix4x4](/engine/6000.7/script-reference/unityengine/matrix4x4.md) |             |

### Remarks

Returned matrix is such that scales along coordinate axes by a vector `v`. The matrix looks like this:

```csharp
using UnityEngine;

public class ExampleScript : MonoBehaviour
{
    void Start()
    {
        Vector3 scale = new Vector3(1, 2, 1);
        Matrix4x4 scaleMatrix = Matrix4x4.Scale(scale);

        Debug.Log(scaleMatrix);
    }
}
```

Additional Resources: [Matrix4x4.TRS](/engine/6000.7/script-reference/unityengine/matrix4x4/trs.md), [Matrix4x4.Rotate](/engine/6000.7/script-reference/unityengine/matrix4x4/rotate.md), [Matrix4x4.Translate](/engine/6000.7/script-reference/unityengine/matrix4x4/translate.md), [Matrix4x4.SetTRS](/engine/6000.7/script-reference/unityengine/matrix4x4/settrs.md) functions.
