---
title: "look(at:from:upVector:relativeTo:)"
framework: realitykit
role: symbol
role_heading: Instance Method
path: "realitykit/hastransform/look(at:from:upvector:relativeto:)"
---

# look(at:from:upVector:relativeTo:)

Positions and orients the entity to look at a target from a given position.

## Declaration

```swift
@MainActor @preconcurrency func look(at target: SIMD3<Float>, from position: SIMD3<Float>, upVector: SIMD3<Float> = SIMD3<Float>(0, 1, 0), relativeTo referenceEntity: Entity?)
```

## Parameters

- `target`: The target position to look at.
- `position`: The new position of the entity.
- `upVector`: The up direction of the entity after moving.
- `referenceEntity`: The entity that defines a frame of reference. Set this to nil to indicate world space.

## Discussion

Discussion You can use this method on any entity, but it’s particularly useful for orienting cameras and lights to aim at a particular point in space.

## See Also

### Moving an entity

- [move(to:relativeTo:)](realitykit/hastransform/move(to:relativeto:)-6lohd.md)
- [move(to:relativeTo:)](realitykit/hastransform/move(to:relativeto:)-6jul8.md)
- [look(at:from:upVector:relativeTo:forward:)](realitykit/hastransform/look(at:from:upvector:relativeto:forward:).md)
- [align(_:to:)](realitykit/hastransform/align(_:to:).md)
