<!--
{
  "availability" : [
    "iOS: 13.0.0 -",
    "iPadOS: 13.0.0 -",
    "macCatalyst: 13.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "RealityKit",
  "identifier" : "/documentation/RealityKit/ARView/trackedRaycast(from:allowing:alignment:updateHandler:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "RealityKit"
    ],
    "preciseIdentifier" : "s:10RealityKit6ARViewC14trackedRaycast4from8allowing9alignment13updateHandlerSo09ARTrackedE0CSgSo7CGPointV_So15ARRaycastTargetVSo0mN9AlignmentVySaySo0M6ResultCGctF"
  },
  "title" : "trackedRaycast(from:allowing:alignment:updateHandler:)"
}
-->

# trackedRaycast(from:allowing:alignment:updateHandler:)

Performs a tracked ray cast, where a ray is cast into the scene from the
center of the camera through a point in the view.

```
@MainActor @preconcurrency func trackedRaycast(from point: CGPoint, allowing target: ARRaycastQuery.Target, alignment: ARRaycastQuery.TargetAlignment, updateHandler: @escaping ([ARRaycastResult]) -> Void) -> ARTrackedRaycast?
```

## Parameters

`point`

A point in the view’s local coordinate system.

`target`

The type of target where the ray should terminate.

`alignment`

The alignment of the target.

`updateHandler`

A closure the method calls to update the list of
results, sorted from nearest to farthest from the camera. The closure is
called on the [`session`](/documentation/RealityKit/ARView/session) instance’s delegate queue.

## Return Value

A tracked ray-cast instance used to update or stop ray
casting. The result is `nil` if the ray cast fails or if the AR
[`session`](/documentation/RealityKit/ARView/session) configuration isn’t
<doc://com.apple.documentation/documentation/ARKit/ARWorldTrackingConfiguration>
or one of its subclasses.

---

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)