<!--
{
  "availability" : [
    "iOS: 18.0.0 -",
    "iPadOS: 18.0.0 -",
    "macCatalyst: 18.0.0 -",
    "macOS: 15.0.0 -",
    "tvOS: 26.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "RealityKit",
  "identifier" : "/documentation/RealityKit/RealityCoordinateSpaceProjecting/entity(at:in:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "RealityKit",
      "SwiftUI"
    ],
    "preciseIdentifier" : "s:19_RealityKit_SwiftUI0A25CoordinateSpaceProjectingP6entity2at2in0A10Foundation6EntityCSgSo7CGPointV_qd__t0cD00eF8ProtocolRd__lF"
  },
  "title" : "entity(at:in:)"
}
-->

# entity(at:in:)

Finds the first entity hit when projecting a ray from a starting point.

```
func entity(at point: CGPoint, in space: some CoordinateSpaceProtocol) -> Entity?
```

## Parameters

`point`

A point in the provided coordinate space.

`space`

The 2D coordinate space in which to interpret the `point`.

## Return Value

The entity at `point`. Returns `nil` if no entity was found.

## Discussion> Important: RealityKit performs hit tests (ray-casts) against collision shapes.
> Entities without a valid ``doc://com.apple.RealityKit/documentation/RealityKit/CollisionComponent`` are ignored by hit tests.

---

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)