---
title: "findEntity(named:)"
framework: realitykit
role: symbol
role_heading: Instance Method
path: "realitykit/entity/findentity(named:)"
---

# findEntity(named:)

Recursively searches all descendant entities for one with the given name.

## Declaration

```swift
@MainActor @preconcurrency func findEntity(named name: String) -> Entity?
```

## Parameters

- `name`: The entity name for which to search.

## Return Value

Return Value An entity with the given name, or nil if no entity is found.

## Discussion

Discussion The findEntity(named:) method conducts a depth-first, recursive search over all of the entity’s descendants for one whose name property matches the given name. The method returns the first match. Entity names need not be unique.

## See Also

### Inspecting an entity

- [scene](realitykit/entity/scene.md)
- [name](realitykit/entity/name.md)
- [debugDescription](realitykit/entity/debugdescription.md)
