---
title: "targetedToEntity(_:)"
framework: swiftui
role: symbol
role_heading: Instance Method
path: "swiftui/gesture/targetedtoentity(_:)"
---

# targetedToEntity(_:)

Requires this gesture to target an entity or a descendant of entity.

## Declaration

```swift
@MainActor @preconcurrency func targetedToEntity(_ entity: Entity) -> some Gesture<EntityTargetValue<Self.Value>>

```

## Parameters

- `entity`: The entity the gesture targets.

## Return Value

Return Value A RealityCoordinateSpaceConverting value containing the original gesture value along with the targeted entity.

## See Also

### Using a gesture with a RealityKit entity

- [targetedToAnyEntity()](swiftui/gesture/targetedtoanyentity().md)
- [targetedToEntity(where:)](swiftui/gesture/targetedtoentity(where:).md)
