# GetNativePtr()

> This method returns an IntPtr representing the native pointer to the XR device if one is available, otherwise the value will be IntPtr.Zero.

## Definition

* **Type:** Method
* **Namespace:** [UnityEngine.XR](/engine/6000.5/script-reference/unityengine/xr.md)
* **Assembly:** UnityEngine.XRModule

> **Warning:**
>
> **Removed.** XRDevice.GetNativePtr is deprecated, and should no longer be used. This API was only supported for legacy VR.

```csharp
public static nint GetNativePtr()
```

### Returns

| Type                                                           | Description                          |
| -------------------------------------------------------------- | ------------------------------------ |
| [IntPtr](https://learn.microsoft.com/dotnet/api/system.intptr) | The native pointer to the XR device. |

### Remarks

This native pointer can be used along with other plugins or extensions to access additional details or functionality related to the XR device.
