# GetLowestCommonAncestor(AccessibilityNode, AccessibilityNode)

> Retrieves the lowest common ancestor of two nodes in the hierarchy. The lowest common ancestor is the node that is the common node that both nodes share in their path to the root node of their branch in the hierarchy.

## Definition

* **Type:** Method
* **Namespace:** [UnityEngine.Accessibility](/engine/6000.0/script-reference/unityengine/accessibility.md)
* **Assembly:** UnityEngine.AccessibilityModule

```csharp
public AccessibilityNode GetLowestCommonAncestor(AccessibilityNode firstNode, AccessibilityNode secondNode)
```

### Parameters

**** (\[AccessibilityNode]\(/engine/6000.0/script-reference/unityengine/accessibility/accessibilitynode)): The first node to find the lowest common ancestor of.**** (\[AccessibilityNode]\(/engine/6000.0/script-reference/unityengine/accessibility/accessibilitynode)): The second node to find the lowest common ancestor of.

### Returns

| Type                                                                                                | Description                                                                                  |
| --------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- |
| [AccessibilityNode](/engine/6000.0/script-reference/unityengine/accessibility/accessibilitynode.md) | The lowest common ancestor of the two given nodes, or `null` if there is no common ancestor. |
