---
title: "hitTest(_:types:)"
framework: realitykit
role: symbol
role_heading: Instance Method
path: "realitykit/arview/hittest(_:types:)"
---

# hitTest(_:types:)

Searches for objects corresponding to a point in the view based on a set of result types.

## Declaration

```swift
@MainActor @preconcurrency func hitTest(_ point: CGPoint, types: ARHitTestResult.ResultType) -> [ARHitTestResult]
```

## Parameters

- `point`: A point in the view’s coordinate system.
- `types`: The hit test search type to look for.

## Return Value

Return Value An array of hit results.

## Discussion

Discussion The method ignores entities that lack a CollisionComponent.

## See Also

### Finding entities at a point in the view

- [entity(at:)](realitykit/arview/entity(at:).md)
- [entities(at:)](realitykit/arview/entities(at:).md)
- [hitTest(_:query:mask:)](realitykit/arview/hittest(_:query:mask:).md)
- [makeRaycastQuery(from:allowing:alignment:)](realitykit/arview/makeraycastquery(from:allowing:alignment:).md)
- [raycast(from:allowing:alignment:)](realitykit/arview/raycast(from:allowing:alignment:).md)
- [trackedRaycast(from:allowing:alignment:updateHandler:)](realitykit/arview/trackedraycast(from:allowing:alignment:updatehandler:).md)
