<!--
{
  "availability" : [
    "iOS: 18.0.0 -",
    "iPadOS: 18.0.0 -",
    "macCatalyst: 18.0.0 -",
    "macOS: 15.0.0 -",
    "tvOS: 26.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "RealityKit",
  "identifier" : "/documentation/RealityKit/HasTransform/look(at:from:upVector:relativeTo:forward:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "RealityKit"
    ],
    "preciseIdentifier" : "s:17RealityFoundation12HasTransformPAAE4look2at4from8upVector10relativeTo7forwardys5SIMD3VySfG_A2lA6EntityCSgAN16ForwardDirectionOtF"
  },
  "title" : "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.

```
@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

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.

---

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)