# SetAnchors(Vector2)

> Sets both anchorMin and anchorMax to the same value, collapsing the anchor to a point.

## Definition

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

```csharp
public void SetAnchors(Vector2 position)
```

### Parameters

**** (\[Vector2]\(/engine/6000.7/script-reference/unityengine/vector2)): The normalized position within the parent RectTransform to assign to both anchors.

### Remarks

Equivalent to assigning the same value to [RectTransform.anchorMin](/engine/6000.7/script-reference/unityengine/recttransform/anchormin.md) and [RectTransform.anchorMax](/engine/6000.7/script-reference/unityengine/recttransform/anchormax.md) individually. Collapsing the anchors to a point is the standard setup for positioning an element at a fixed location regardless of parent size. The [RectTransform.sizeDelta](/engine/6000.7/script-reference/unityengine/recttransform/sizedelta.md) and [RectTransform.anchoredPosition](/engine/6000.7/script-reference/unityengine/recttransform/anchoredposition.md) are not modified.

Additional Resources: [RectTransform.SetPivotAndAnchors](/engine/6000.7/script-reference/unityengine/recttransform/setpivotandanchors.md).
