# GetNextFocusable(Focusable, FocusChangeDirection)

> Get the next element in the given direction.

## Definition

* **Type:** Method
* **Namespace:** [UnityEngine.UIElements](/engine/6000.5/script-reference/unityengine/uielements.md)
* **Assembly:** UnityEngine.UIElementsModule

```csharp
Focusable GetNextFocusable(Focusable currentFocusable, FocusChangeDirection direction)
```

### Parameters

**** (\[Focusable]\(/engine/6000.5/script-reference/unityengine/uielements/focusable)): **** (\[FocusChangeDirection]\(/engine/6000.5/script-reference/unityengine/uielements/focuschangedirection)):&#x20;

### Returns

| Type                                                                             | Description |
| -------------------------------------------------------------------------------- | ----------- |
| [Focusable](/engine/6000.5/script-reference/unityengine/uielements/focusable.md) |             |

### Remarks

For example, in a [VisualElementFocusRing](/engine/6000.5/script-reference/unityengine/uielements/visualelementfocusring.md), the next element in the [\_right](/engine/6000.5/script-reference/unityengine/uielements/visualelementfocuschangedirection/right.md) by default is the element to the right of the current element. More precisely, the next element is the focusable element whose [\_tabIndex](/engine/6000.5/script-reference/unityengine/uielements/focusable/tabindex.md) is the closest to the current element in increasing order. If no such element is found, the process wraps around and continues looking for a focusable element starting at tabIndex=0 and proceeding in increasing order.

When the [EventDispatcher](/engine/6000.5/script-reference/unityengine/uielements/eventdispatcher.md) processes navigation and pointer events, it automatically calls this method to generate Focus events.

The Focus event's [\_target](/engine/6000.5/script-reference/unityengine/uielements/eventbase/target.md) matches the value returned by this method to generate it.
