<!--
{
  "availability" : [
    "iOS: 16.0.0 -",
    "iPadOS: 16.0.0 -",
    "macCatalyst: -"
  ],
  "documentType" : "symbol",
  "framework" : "NearbyInteraction",
  "identifier" : "/documentation/NearbyInteraction/NISession/worldTransform(for:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Nearby Interaction",
      "NearbyInteraction"
    ],
    "preciseIdentifier" : "s:So9NISessionC17NearbyInteractionE14worldTransform3forSo13simd_float4x4aSgSo14NINearbyObjectC_tF"
  },
  "title" : "worldTransform(for:)"
}
-->

# worldTransform(for:)

Returns a world transform to integrate a nearby object in an AR experience.

```
func worldTransform(for object: NINearbyObject) -> simd_float4x4?
```

## Parameters

`object`

The object for which to calculate a world transform.

## Return Value

A world transform in ARKit’s coordinate space.

## Discussion

This <doc://com.apple.documentation/documentation/ARKit> transform represents the given object’s position in the physical environment, if it’s available. Otherwise, this function returns `nil`.

With this transform, you can:

- Overlay 3D virtual content onto a camera-feed visualization where the nearby object resides in the physical environment, such as done by an AR app’s renderer.
- Play a 3D-spatial sound from the location of the nearby object, for example, by using <doc://com.apple.documentation/documentation/PHASE>.

---

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)