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

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

Positions and orients the entity such that it looks at certain target from a give 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?, forward: Entity.ForwardDirection = .negativeZ)
```

## Parameters

- `target`: The target position to look at.
- `position`: The new position of the entity.
- `upVector`: The up direction of the entity.
- `referenceEntity`: The reference entity which defines the frame of reference. Can be nil, which is equivalent to “world space”.
- `forward`: Use default forward (.negativeZ). Can be set to .positiveZ for non-camera entities

## Discussion

Discussion This function moves the entity to the specified position. It rotates the entity such that the forward direction is pointing towards target. It further makes sure that entity’s up direction aligns with the specified upVector. note: This method can be used for non-camera entities.

## 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:)](realitykit/hastransform/look(at:from:upvector:relativeto:).md)
- [align(_:to:)](realitykit/hastransform/align(_:to:).md)
