# InstanceIDsToValidArray

> Translates an array of instance IDs to an array of bools indicating whether a given instance ID from instanceIDs corresponds to a valid Object in memory. The Object could have been deleted or not loaded into memory yet.

## Definition

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

## InstanceIDsToValidArray(NativeArray\<int>, NativeArray\<bool>)

Translates an array of instance IDs to an array of bools indicating whether a given instance ID from **instanceIDs** corresponds to a valid [Object](/engine/6000.0/script-reference/unityengine/object.md) in memory. The [Object](/engine/6000.0/script-reference/unityengine/object.md) could have been deleted or not loaded into memory yet.

```csharp
public static void InstanceIDsToValidArray(NativeArray<int> instanceIDs, NativeArray<bool> validArray)
```

### Parameters

**** (\[NativeArray\<int>]\(/engine/6000.0/script-reference/unity/collections/nativearray1)): IDs of [Object](/engine/6000.0/script-reference/unityengine/object.md) instances.**** (\[NativeArray\<bool>]\(/engine/6000.0/script-reference/unity/collections/nativearray1)): Array of bools indicating whether a given instance ID corresponds to a valid [Object](/engine/6000.0/script-reference/unityengine/object.md).

### Remarks

**instanceIDs** and **validArray** must be of the same length. The value at each index in **validArray** corresponds with the instance ID at the same index in **instanceIDs**.

## InstanceIDsToValidArray(ReadOnlySpan\<int>, Span\<bool>)

Translates an array of instance IDs to an array of bools indicating whether a given instance ID from **instanceIDs** corresponds to a valid [Object](/engine/6000.0/script-reference/unityengine/object.md) in memory. The [Object](/engine/6000.0/script-reference/unityengine/object.md) could have been deleted or not loaded into memory yet.

```csharp
public static void InstanceIDsToValidArray(ReadOnlySpan<int> instanceIDs, Span<bool> validArray)
```

### Parameters

**** (\[ReadOnlySpan\<int>]\(https\://learn.microsoft.com/dotnet/api/system.readonlyspan-1)): IDs of [Object](/engine/6000.0/script-reference/unityengine/object.md) instances.**** (\[Span\<bool>]\(https\://learn.microsoft.com/dotnet/api/system.span-1)): Array of bools indicating whether a given instance ID corresponds to a valid [Object](/engine/6000.0/script-reference/unityengine/object.md).

### Remarks

**instanceIDs** and **validArray** must be of the same length. The value at each index in **validArray** corresponds with the instance ID at the same index in **instanceIDs**.
