Information about a real-world surface found by examining a point on the screen.


class ARRaycastResult : NSObject


If you use RealityKit or SceneKit as your renderer, you can search for real-world surfaces at a screen point using the raycastQuery(from:allowing:alignment:) function of ARSCNView.

If you use a custom renderer, you can find real-world positions using screen points with:

For tracked ray-casting, you call trackedRaycast(_:updateHandler:) on your app's current ARSession.


Identifying Results

var worldTransform: simd_float4x4

The position, rotation, and scale, of the ray's intersection with the target.

var anchor: ARAnchor?

The anchor for the plane that the ray intersected.

var target: ARRaycastQuery.Target

The type of plane that the ray intersected.

enum ARRaycastQuery.Target

The types of plane you allow a raycast to intersect with.

var targetAlignment: ARRaycastQuery.TargetAlignment

The alignment of the plane that the ray intersected.

enum ARRaycastQuery.TargetAlignment

A specification that indicates a target's alignment with respect to gravity.


Inherits From

Conforms To

See Also


class ARRaycastQuery

A mathematical ray you use to find 3D positions on real-world surfaces.

class ARTrackedRaycast

A ray-cast query that ARKit repeats in succession to give you refined results over time.


Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software