---
title: BlobObjectReference<T>
product: Unity Editor
version: '7000.0'
latest_version: '7000.0'
status: This page documents version 7000.0. The latest version is 7000.0.
canonical: https://docs.unity.com/en-us/engine/7000.0/script-reference/unityengine/blobobjectreference1
latest_url: https://docs.unity.com/en-us/engine/7000.0/script-reference/unityengine/blobobjectreference1.md
last_updated: 2026-11-07
generated_at: 2026-11-10T00:50:50.261Z
locale: en-us
---

# BlobObjectReference<T>

> A reference that keeps the blob data stored in a BlobObject alive, so that jobs and Burst-compiled code can read it.

## Definition

* **Type:** Struct
* **Namespace:** [UnityEngine](/engine/7000.0/script-reference/unityengine.md)
* **Assembly:** UnityEngine.AnimationModule
* **Implements:** [IDisposable](https://learn.microsoft.com/dotnet/api/system.idisposable)

```csharp
public struct BlobObjectReference<T> : IDisposable where T : unmanaged
```

## Remarks

Use this struct to read the blob data of a [BlobObject](/engine/7000.0/script-reference/unityengine/blobobject.md) from jobs and Burst-compiled code without copying it. Get a reference from [BlobObject.AcquireReference](/engine/7000.0/script-reference/unityengine/blobobject/acquirereference.md), then check [BlobObjectReference\<T>.IsValid](/engine/7000.0/script-reference/unityengine/blobobjectreference1/isvalid.md) before you use it.

The data stays alive until you call [BlobObjectReference\<T>.Dispose](/engine/7000.0/script-reference/unityengine/blobobjectreference1/dispose.md), even if the object is destroyed or its data is replaced, so always dispose the reference when you finish with it. Use [BlobObjectReference\<T>.Clone](/engine/7000.0/script-reference/unityengine/blobobjectreference1/clone.md) to get another reference that you dispose separately, for example to give another thread its own reference.

You can't store the reference in serialized data. Reference the BlobObject itself instead.

The following example uses the `Unity.Animations`, `Unity.Collections`, `Unity.Entities`, and `UnityEngine` namespaces. It stores a custom blob in a `BlobObject`, reads the data back through a `BlobObjectReference`, and then disposes the reference and destroys the object.

Additional Resources: [BlobObject](/engine/7000.0/script-reference/unityengine/blobobject.md)

## Examples

```csharp
// This example stores marker times in a BlobObject, reads them back through a reference, and sums them.
// A custom blob type can hold only unmanaged data, such as values and BlobArray fields.
public struct MarkerTable
{
    public BlobArray<float> Times;
}

public static float StoreAndSumMarkerTimes(float[] markerTimes)
{
    const int version = 1;

    // Build the blob asset. SetBlobAsset copies it, so you can dispose the original afterwards.
    BlobObject blobObject = new BlobObject();
    using (BlobBuilder blobBuilder = new BlobBuilder(Allocator.Temp))
    {
        ref MarkerTable root = ref blobBuilder.ConstructRoot<MarkerTable>();
        BlobBuilderArray<float> times = blobBuilder.Allocate(ref root.Times, markerTimes.Length);
        for (int i = 0; i < markerTimes.Length; ++i)
        {
            times[i] = markerTimes[i];
        }

        using (BlobAssetReference<MarkerTable> blobAsset =
            blobBuilder.CreateBlobAssetReference<MarkerTable>(Allocator.Temp))
        {
            blobObject.SetBlobAsset(blobAsset, version);
        }
    }

    // Acquire a reference with the same version. The data stays alive until you dispose the reference.
    BlobObjectReference<MarkerTable> reference =
        blobObject.AcquireReference<MarkerTable>(version);

    // Read the data. The returned blob asset reference is a view of the stored data, so don't dispose this blob asset reference.
    BlobAssetReference<MarkerTable> markerTable = reference.AsBlobAssetReference();
    float sum = 0f;
    ref MarkerTable table = ref markerTable.Value;
    for (int i = 0; i < table.Times.Length; ++i)
    {
        sum += table.Times[i];
    }

    // Dispose the reference, then destroy the object.
    reference.Dispose();
    Object.DestroyImmediate(blobObject);

    return sum;
}
```

## Properties

| Property                                                                               | Description                                |
| -------------------------------------------------------------------------------------- | ------------------------------------------ |
| [IsValid](/engine/7000.0/script-reference/unityengine/blobobjectreference1/isvalid.md) | Whether the reference points to blob data. |

## Static Properties

| Property                                                                                 | Description                                                                                                 |
| ---------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- |
| [TypeHash](/engine/7000.0/script-reference/unityengine/blobobjectreference1/typehash.md) | Hash that identifies the type of the blob root, used to check that a BlobObject stores the type you expect. |

## Methods

| Method                                                                                                           | Description                                                                    |
| ---------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------ |
| [AsBlobAssetReference](/engine/7000.0/script-reference/unityengine/blobobjectreference1/asblobassetreference.md) | Returns a blob asset reference to the data that this reference points to.      |
| [Clone](/engine/7000.0/script-reference/unityengine/blobobjectreference1/clone.md)                               | Acquires another reference to the same data. Both references must be disposed. |
| [Dispose](/engine/7000.0/script-reference/unityengine/blobobjectreference1/dispose.md)                           | Releases this reference to the blob data.                                      |
