# NewWeakGlobalRef(nint)

> Creates a new global weak reference to the object referred to by the \<tt\>obj\</tt\> argument.

## Definition

* **Type:** Method
* **Namespace:** [UnityEngine](/engine/7000.0/script-reference/unityengine.md)
* **Assembly:** UnityEngine.AndroidJNIModule

## NewWeakGlobalRef(IntPtr)

```csharp
public static nint NewWeakGlobalRef(nint obj)
```

### Parameters

**** (\[IntPtr]\(https\://learn.microsoft.com/dotnet/api/system.intptr)): The reference to convert.

### Returns

| Type                                                           | Description                                                                                                        |
| -------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------ |
| [IntPtr](https://learn.microsoft.com/dotnet/api/system.intptr) | The new reference, or null if the object referred to by the original reference has already been garbage collected. |

### Remarks

Additional Resources: [Java Native Interface Specification (Oracle)](http://download.oracle.com/javase/1.5.0/docs/guide/jni/spec/jniTOC.html)
