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

# findEntity(named:)

Searches the scene’s anchor entity hierarchies for an entity with the given name.

## Declaration

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

## Parameters

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

## Return Value

Return Value The first entity found with the given name, or nil if none is found.

## Discussion

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

## See Also

### Finding entities

- [performQuery(_:)](realitykit/scene/performquery(_:).md)
- [findEntity(id:)](realitykit/scene/findentity(id:).md)
