# SetSelection

> Sets the current selection to a single node, making all other nodes unselected.

## Definition

* **Type:** Method
* **Namespace:** [Unity.Hierarchy](/engine/6000.5/script-reference/unity/hierarchy.md)
* **Assembly:** UnityEngine.HierarchyModule

## SetSelection(HierarchyNode)

Sets the current selection to a single node, making all other nodes unselected.

```csharp
public void SetSelection(in HierarchyNode node)
```

### Parameters

**** (\[HierarchyNode]\(/engine/6000.5/script-reference/unity/hierarchy/hierarchynode)): The [HierarchyNode](/engine/6000.5/script-reference/unity/hierarchy/hierarchynode.md) to set as the selection.

## SetSelection(ReadOnlySpan\<HierarchyNode>)

Sets the current selection to the specified nodes, making all other nodes unselected.

```csharp
public void SetSelection(ReadOnlySpan<HierarchyNode> nodes)
```

### Parameters

**** (\[ReadOnlySpan\<HierarchyNode>]\(https\://learn.microsoft.com/dotnet/api/system.readonlyspan-1)): The [HierarchyNode](/engine/6000.5/script-reference/unity/hierarchy/hierarchynode.md)s to set as the selection.
