# operator *

> Multiplies a vector by a number.

## Definition

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

## operator \*(Vector4, float)

Multiplies a vector by a number.

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

### Parameters

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

### Returns

| Type                                                              | Description |
| ----------------------------------------------------------------- | ----------- |
| [Vector4](/engine/6000.7/script-reference/unityengine/vector4.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,6.0,8.0)
        print(new Vector4(1, 2, 3, 4) * 2.0f);
    }
}
```

## operator \*(float, Vector4)

Multiplies a number by a vector.

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

### Parameters

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

### Returns

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

### Remarks

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

### Examples

```csharp
using UnityEngine;

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