---
title: "raycastQuery(from:allowing:alignment:)"
framework: arkit
role: symbol
role_heading: Instance Method
path: "arkit/arframe/raycastquery(from:allowing:alignment:)"
---

# raycastQuery(from:allowing:alignment:)

Get a ray-cast query for a screen point.

## Declaration

```swift
func raycastQuery(from point: CGPoint, allowing target: ARRaycastQuery.Target, alignment: ARRaycastQuery.TargetAlignment) -> ARRaycastQuery
```

## Parameters

- `point`: A normalized coordinate in the UI system, where 0 is top-left, and 1 is bottom-right.
- `target`: The types of plane you allow this ray cast to intersect with.
- `alignment`: An alignment with respect to gravity a plane must have to interset this ray.

## Discussion

Discussion To cast the ray, you pass the resulting query to your current session via raycast(_:) or trackedRaycast(_:updateHandler:).

## See Also

### Tracking and interacting with the real world

- [anchors](arkit/arframe/anchors.md)
- [hitTest(_:types:)](arkit/arframe/hittest(_:types:).md)
