# operator -(Vector2)

> Negates a vector.

## Definition

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

```csharp
public static Vector2 operator -(Vector2 a)
```

### Parameters

**** (\[Vector2]\(/engine/6000.6/script-reference/unityengine/vector2)): The vector to negate.

### Returns

| Type                                                              | Description                                               |
| ----------------------------------------------------------------- | --------------------------------------------------------- |
| [Vector2](/engine/6000.6/script-reference/unityengine/vector2.md) | The negative of the vector, returned as a Vector2 struct. |

### Remarks

Each component in the vector is negated, to obtain its negative value. The negative of a vector has the same magnitude but opposite direction.

### Examples

```csharp
using UnityEngine;

public class Example : MonoBehaviour
{
    void Start()
    {
       // Create a vector.
       Vector2 A = new Vector2(1, 2);

       // Find the negative value.
       Vector2 B = - A;

       // Print the result.
        print(B + " is the negative of " + A);
    }
}
```
