# Set(float, float)

> Set x and y components of an existing Vector2.

## Definition

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

```csharp
public void Set(float newX, float newY)
```

### Parameters

**** (\[float]\(https\://learn.microsoft.com/dotnet/api/system.single)): The x component to set.**** (\[float]\(https\://learn.microsoft.com/dotnet/api/system.single)): The y component to set.
