---
title: "entities(matching:updatingSystemWhen:)"
framework: realitykit
role: symbol
role_heading: Instance Method
path: "realitykit/sceneupdatecontext/entities(matching:updatingsystemwhen:)"
---

# entities(matching:updatingSystemWhen:)

Returns all entities which pass the query predicate of the query.

## Declaration

```swift
func entities(matching query: EntityQuery, updatingSystemWhen condition: SystemUpdateCondition) -> QueryResult<Entity>
```

## Parameters

- `query`: The query identifying which entities you want to fetch.
- `condition`: How often the doc://com.apple.RealityKit/documentation/RealityKit/System is updated (if the query is not empty).

## Mentioned in

Implementing systems for entities in a scene

## Discussion

Discussion Calling this function can increase the rate at which RealityKit calls the update(context:) method. If condition is not met for the current update, this method returns an empty result.
