<!--
{
  "availability" : [
    "iOS: 13.0.0 -",
    "iPadOS: 13.0.0 -",
    "macCatalyst: 14.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "RealityKit",
  "identifier" : "/documentation/RealityKit/EntityTranslationGestureRecognizer",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "RealityKit"
    ],
    "preciseIdentifier" : "c:@M@RealityKit@objc(cs)EntityTranslationGestureRecognizer"
  },
  "title" : "EntityTranslationGestureRecognizer"
}
-->

# EntityTranslationGestureRecognizer

A gesture recognizer that uses a pan gesture to move an entity.

```
@MainActor @objc @preconcurrency class EntityTranslationGestureRecognizer
```

## Overview

A gesture recognizer that handles pan and dragging gestures on an entity.

## Topics

### Creating a recognizer

[`init(target: Any?, action: Selector?)`](/documentation/RealityKit/EntityTranslationGestureRecognizer/init(target:action:))

### Using the recognizer

[`var entity: (any HasCollision)?`](/documentation/RealityKit/EntityTranslationGestureRecognizer/entity)

The entity the receiver is associated with

[`func canPrevent(UIGestureRecognizer) -> Bool`](/documentation/RealityKit/EntityTranslationGestureRecognizer/canPrevent(_:))

[`func location(in: Entity?) -> SIMD3<Float>?`](/documentation/RealityKit/EntityTranslationGestureRecognizer/location(in:))

Returns the unprojected location of the gesture represented by the receiver in the space of the given entity.

[`func reset()`](/documentation/RealityKit/EntityTranslationGestureRecognizer/reset())

Overridden to reset internal state when a gesture recognition attempt completes.

[`func setTranslation(SIMD3<Float>, in: Entity?)`](/documentation/RealityKit/EntityTranslationGestureRecognizer/setTranslation(_:in:))

Sets the translation of the receiver in the entity’s coordinate space

[`func touchesBegan(Set<UITouch>, with: UIEvent)`](/documentation/RealityKit/EntityTranslationGestureRecognizer/touchesBegan(_:with:))

Sent to the gesture recognizer when one or more fingers touch down on the associated entity.

[`func touchesCancelled(Set<UITouch>, with: UIEvent)`](/documentation/RealityKit/EntityTranslationGestureRecognizer/touchesCancelled(_:with:))

Sent to the gesture recognizer when a system event (such as an incoming phone call) cancels a touch event.

[`func touchesEnded(Set<UITouch>, with: UIEvent)`](/documentation/RealityKit/EntityTranslationGestureRecognizer/touchesEnded(_:with:))

Sent to the gesture recognizer when one or more fingers lift from the associated view.

[`func touchesMoved(Set<UITouch>, with: UIEvent)`](/documentation/RealityKit/EntityTranslationGestureRecognizer/touchesMoved(_:with:))

Sent to the gesture recognizer when one or more fingers move in the associated view.

[`func translation(in: Entity?) -> SIMD3<Float>?`](/documentation/RealityKit/EntityTranslationGestureRecognizer/translation(in:))

The translation of the gesture in the space of the specified entity.

[`func velocity(in: Entity?) -> SIMD3<Float>`](/documentation/RealityKit/EntityTranslationGestureRecognizer/velocity(in:))

The velocity of the translation gesture in the space of the specified entity.

## Relationships

### Conforms To

[`CustomDebugStringConvertible`](/documentation/Swift/CustomDebugStringConvertible)

[`EntityGestureRecognizer`](/documentation/RealityKit/EntityGestureRecognizer)

[`Hashable`](/documentation/Swift/Hashable)

[`Sendable`](/documentation/Swift/Sendable)

[`NSObjectProtocol`](/documentation/ObjectiveC/NSObjectProtocol)

[`CustomStringConvertible`](/documentation/Swift/CustomStringConvertible)

[`Equatable`](/documentation/Swift/Equatable)

[`CVarArg`](/documentation/Swift/CVarArg)

[`SendableMetatype`](/documentation/Swift/SendableMetatype)

### Inherits From

[`UIGestureRecognizer`](/documentation/UIKit/UIGestureRecognizer)

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)