<!--
{
  "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/unproject(_:from:to:ontoPlane:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "RealityKit",
      "SwiftUI"
    ],
    "preciseIdentifier" : "s:19_RealityKit_SwiftUI0A25CoordinateSpaceProjectingP9unproject_4from2to9ontoPlanes5SIMD3VySfGSgSo7CGPointV_qd__qd_0_So13simd_float4x4at0cD00eF8ProtocolRd__0A10Foundation0aeF0Rd_0_r0_lF"
  },
  "title" : "unproject(_:from:to:ontoPlane:)"
}
-->

# unproject(_:from:to:ontoPlane:)

Unprojects a point from the view onto a plane in 3D world coordinates.

```
func unproject(_ point: CGPoint, from space: some CoordinateSpaceProtocol, to realitySpace: some RealityCoordinateSpace, ontoPlane planeTransform: float4x4) -> SIMD3<Float>?
```

## Parameters

`point`

A point in the provided coordinate space.

`space`

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

`realitySpace`

The 3D coordinate space in which `planeTransform`
interprets the point.

`planeTransform`

The transform used to define the coordinate
system of the plane relative to the scene. The coordinate
system’s positive y-axis is assumed to be the normal of the
plane.

## Return Value

3D position in `realitySpace`, or nil if unprojection is not
possible.

## Discussion

A 2D point in the view’s coordinate space can refer to any point along a
line segment in the 3D coordinate space. Unprojecting gets the 3D
position of the point along this line segment that intersects the
provided plane.

> Note: Unprojection is not possible if the plane is parallel to the
> line segment, or if the view does not have a currently active camera.

---

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)