# GetNodesWithoutFlags

> Gets all hierarchy nodes that do not have all of the specified flags set.

## Definition

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

## GetNodesWithoutFlags(HierarchyNodeFlags, Span\<HierarchyNode>)

Gets all hierarchy nodes that do not have all of the specified flags set.

```csharp
public int GetNodesWithoutFlags(HierarchyNodeFlags flags, Span<HierarchyNode> outNodes)
```

### Parameters

**** (\[HierarchyNodeFlags]\(/engine/6000.7/script-reference/unity/hierarchy/hierarchynodeflags)): The flags to exclude when matching hierarchy nodes.**** (\[Span\<HierarchyNode>]\(https\://learn.microsoft.com/dotnet/api/system.span-1)): The output span to write matching hierarchy nodes into.

### Returns

| Type                                                       | Description                                         |
| ---------------------------------------------------------- | --------------------------------------------------- |
| [int](https://learn.microsoft.com/dotnet/api/system.int32) | The number of nodes written in the `outNodes` span. |

## GetNodesWithoutFlags(HierarchyNodeFlags)

Gets all hierarchy nodes that do not have all of the specified flags set.

```csharp
public HierarchyNode[] GetNodesWithoutFlags(HierarchyNodeFlags flags)
```

### Parameters

**** (\[HierarchyNodeFlags]\(/engine/6000.7/script-reference/unity/hierarchy/hierarchynodeflags)): The flags to exclude when matching hierarchy nodes.

### Returns

| Type                                                                                  | Description                                                                                 |
| ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- |
| [HierarchyNode\[\]](/engine/6000.7/script-reference/unity/hierarchy/hierarchynode.md) | An array that contains all hierarchy nodes that do not have all of the specified flags set. |
