# operator *

> Multiplies a vector by another vector.

## Definition

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

## operator \*(Vector2, Vector2)

Multiplies a vector by another vector.

```csharp
public static Vector2 operator *(Vector2 a, Vector2 b)
```

### Parameters

**** (\[Vector2]\(/engine/6000.5/script-reference/unityengine/vector2)): The first vector to multiply.**** (\[Vector2]\(/engine/6000.5/script-reference/unityengine/vector2)): The second vector to multiply.

### Returns

| Type                                                              | Description |
| ----------------------------------------------------------------- | ----------- |
| [Vector2](/engine/6000.5/script-reference/unityengine/vector2.md) |             |

### Remarks

Multiplies each component of `a` by its matching component from `b`.

## operator \*(Vector2, float)

Multiplies a vector by a number.

```csharp
public static Vector2 operator *(Vector2 a, float d)
```

### Parameters

**** (\[Vector2]\(/engine/6000.5/script-reference/unityengine/vector2)): The vector to multiply by.**** (\[float]\(https\://learn.microsoft.com/dotnet/api/system.single)): The number to multiply by.

### Returns

| Type                                                              | Description |
| ----------------------------------------------------------------- | ----------- |
| [Vector2](/engine/6000.5/script-reference/unityengine/vector2.md) |             |

### Remarks

Multiplies each component of `a` by a number `d`.

### Examples

```csharp
using UnityEngine;

public class Example : MonoBehaviour
{
    void Start()
    {
        // make the vector twice longer: prints (2.0,4.0)
        print(new Vector2(1, 2) * 2.0f);
    }
}
```

## operator \*(float, Vector2)

Multiplies a vector by a number.

```csharp
public static Vector2 operator *(float d, Vector2 a)
```

### Parameters

**** (\[float]\(https\://learn.microsoft.com/dotnet/api/system.single)): The number to multiply by.**** (\[Vector2]\(/engine/6000.5/script-reference/unityengine/vector2)): The vector to multiply by.

### Returns

| Type                                                              | Description |
| ----------------------------------------------------------------- | ----------- |
| [Vector2](/engine/6000.5/script-reference/unityengine/vector2.md) |             |

### Remarks

Multiplies each component of `a` by a number `d`.

### Examples

```csharp
using UnityEngine;

public class Example : MonoBehaviour
{
    void Start()
    {
        // make the vector twice longer: prints (2.0,4.0)
        print(2.0f * new Vector2(1, 2));
    }
}
```
