---
title: "setTranslation(_:in:)"
framework: realitykit
role: symbol
role_heading: Instance Method
path: "realitykit/entitytranslationgesturerecognizer/settranslation(_:in:)"
---

# setTranslation(_:in:)

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

## Declaration

```swift
@MainActor @preconcurrency func setTranslation(_ translation: SIMD3<Float>, in entity: Entity?)
```

## Parameters

- `translation`: A point that identifies the new translation value.
- `entity`: An entity in whose space the translation is to occur. A nil entity will result in world space.

## See Also

### Using the recognizer

- [entity](realitykit/entitytranslationgesturerecognizer/entity.md)
- [canPrevent(_:)](realitykit/entitytranslationgesturerecognizer/canprevent(_:).md)
- [location(in:)](realitykit/entitytranslationgesturerecognizer/location(in:).md)
- [reset()](realitykit/entitytranslationgesturerecognizer/reset().md)
- [touchesBegan(_:with:)](realitykit/entitytranslationgesturerecognizer/touchesbegan(_:with:).md)
- [touchesCancelled(_:with:)](realitykit/entitytranslationgesturerecognizer/touchescancelled(_:with:).md)
- [touchesEnded(_:with:)](realitykit/entitytranslationgesturerecognizer/touchesended(_:with:).md)
- [touchesMoved(_:with:)](realitykit/entitytranslationgesturerecognizer/touchesmoved(_:with:).md)
- [translation(in:)](realitykit/entitytranslationgesturerecognizer/translation(in:).md)
- [velocity(in:)](realitykit/entitytranslationgesturerecognizer/velocity(in:).md)
