<!--
{
  "availability" : [
    "iOS: 13.0.0 -",
    "iPadOS: 13.0.0 -",
    "macCatalyst: 13.0.0 -",
    "macOS: 10.15.0 -",
    "tvOS: 26.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "RealityKit",
  "identifier" : "/documentation/RealityKit/ARView/hitTest(_:query:mask:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "RealityKit"
    ],
    "preciseIdentifier" : "s:10RealityKit6ARViewC7hitTest_5query4maskSay0A10Foundation16CollisionCastHitVGSo7CGPointV_AG0iJ9QueryTypeOAG0I5GroupVtF"
  },
  "title" : "hitTest(_:query:mask:)"
}
-->

# hitTest(_:query:mask:)

Searches for objects corresponding to a point in the view based on a
query and a collision mask.

```
@MainActor @preconcurrency func hitTest(_ point: CGPoint, query: CollisionCastQueryType = .all, mask: CollisionGroup = .all) -> [CollisionCastHit]
```

## Parameters

`point`

A point in the view’s coordinate system.

`query`

The query type.

`mask`

A collision mask that can be used to prevent hits with certain
objects.

## Return Value

An array of hit results.

## Discussion

The method ignores entities that lack a [`CollisionComponent`](/documentation/RealityKit/CollisionComponent).

---

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)