<!--
{
  "availability" : [
    "iOS: 13.0.0 -",
    "iPadOS: 13.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "ARKit",
  "identifier" : "/documentation/ARKit/ARSession/trackedRaycast(_:updateHandler:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "ARKit"
    ],
    "preciseIdentifier" : "c:objc(cs)ARSession(im)trackedRaycast:updateHandler:"
  },
  "title" : "trackedRaycast(_:updateHandler:)"
}
-->

# trackedRaycast(_:updateHandler:)

Repeats a ray-cast query over time to notify you of updated surfaces in the physical environment.

```
func trackedRaycast(_ query: ARRaycastQuery, updateHandler: @escaping ([ARRaycastResult]) -> Void) -> ARTrackedRaycast?
```

## Parameters

`query`

The ray-cast query that ARKit will repeat. If you use a standard renderer, you ask the standard renderer to provide the ray-cast query; see Finding Real-World Surfaces of [`ARSCNView`](/documentation/ARKit/ARSCNView). If you use a custom renderer, you create a ray-cast query by specifying a point on a particular frame; see `Finding Real-World Surfaces` in [`ARFrame`](/documentation/ARKit/ARFrame).

`updateHandler`

A closure you provide that ARKit calls every time it has an updated ray-cast result for you. Use this opportunity to update the position of any virtual content your app may have placed using the prior results of the tracked ray cast. ARKit invokes this closure on your session’s delegate queue.

## Discussion

A tracked ray cast wraps a ray-cast query that the session calls repeatedly, each time invoking your update handler to provide you with new results.

When you’re ready to stop a tracked ray cast, call [`stopTracking()`](/documentation/ARKit/ARTrackedRaycast/stopTracking()).

---

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)