---
title: BlobObject
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/blobobject
latest_url: https://docs.unity.com/en-us/engine/7000.0/script-reference/unityengine/blobobject.md
last_updated: 2026-11-07
generated_at: 2026-11-10T21:37:00.678Z
locale: en-us
---

# BlobObject

> A Unity object that stores a blob of contiguous bytes that jobs can read without copying the data.

## Definition

* **Type:** Class
* **Namespace:** [UnityEngine](/engine/7000.0/script-reference/unityengine.md)
* **Assembly:** UnityEngine.AnimationModule
* **Inherits from:** [Object](/engine/7000.0/script-reference/unityengine/object.md)

```csharp
public class BlobObject : Object
```

## Remarks

Jobs that the Burst compiler compiles can read the blob data in parallel through a [BlobObjectReference\<T>](/engine/7000.0/script-reference/unityengine/blobobjectreference1.md). Reading the data doesn't copy it, so reading is cheap enough for performance-critical code.

A `BlobObject` is a [Object](/engine/7000.0/script-reference/unityengine/object.md), so it also benefits from the object management that Unity provides. The management includes garbage collection, deduplication of the `BlobObject` instances that the same [MonoBehaviour](/engine/7000.0/script-reference/unityengine/monobehaviour.md) references, and authoring in the Unity Editor.

To store data, call [BlobObject.SetBlobAsset](/engine/7000.0/script-reference/unityengine/blobobject/setblobasset.md) with a [BlobAssetReference\<T>](/engine/7000.0/script-reference/unity/entities/blobassetreference1.md). To read the data, call [BlobObject.AcquireReference](/engine/7000.0/script-reference/unityengine/blobobject/acquirereference.md) to get a reference, and dispose the reference when you finish with it. To read the data as a `BlobAssetReference`, call [BlobObjectReference\<T>.AsBlobAssetReference](/engine/7000.0/script-reference/unityengine/blobobjectreference1/asblobassetreference.md) on the reference.

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: [BlobObjectReference\<T>](/engine/7000.0/script-reference/unityengine/blobobjectreference1.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;
}
```

## Constructors

| Constructor                                                                    | Description                  |
| ------------------------------------------------------------------------------ | ---------------------------- |
| [BlobObject()](/engine/7000.0/script-reference/unityengine/blobobject/ctor.md) | Creates an empty BlobObject. |

## Methods

| Method                                                                                                   | Description                                                                                                                         |
| -------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------- |
| [AcquireReference](/engine/7000.0/script-reference/unityengine/blobobject/acquirereference.md)           | Acquires a reference that keeps the blob data stored in this object alive, even if the object is destroyed or its data is replaced. |
| [SetBlobAsset](/engine/7000.0/script-reference/unityengine/blobobject/setblobasset.md)                   | Replaces the data stored in this object with a copy of a blob asset.                                                                |
| [SetUntypedBlobData](/engine/7000.0/script-reference/unityengine/blobobject/setuntypedblobdata.md)       | Replaces the data stored in this object with a copy of the given data, type hash, and version.                                      |
| [TryGetUntypedBlobData](/engine/7000.0/script-reference/unityengine/blobobject/trygetuntypedblobdata.md) | Gets the data stored in this object without checking its type or version, for example to migrate data written with an older layout. |

## Inheritance

**Inherited Members:**

* [Object.GetEntityId()](/engine/7000.0/script-reference/unityengine/object/getentityid.md)
* [Object.GetHashCode()](/engine/7000.0/script-reference/unityengine/object/gethashcode.md)
* [Object.InstantiateAsync\<T>(T)](/engine/7000.0/script-reference/unityengine/object/instantiateasync.md)
* [Object.InstantiateAsync\<T>(T, Transform)](/engine/7000.0/script-reference/unityengine/object/instantiateasync.md)
* [Object.InstantiateAsync\<T>(T, Vector3, Quaternion)](/engine/7000.0/script-reference/unityengine/object/instantiateasync.md)
* [Object.InstantiateAsync\<T>(T, Transform, Vector3, Quaternion)](/engine/7000.0/script-reference/unityengine/object/instantiateasync.md)
* [Object.InstantiateAsync\<T>(T, int)](/engine/7000.0/script-reference/unityengine/object/instantiateasync.md)
* [Object.InstantiateAsync\<T>(T, int, Transform)](/engine/7000.0/script-reference/unityengine/object/instantiateasync.md)
* [Object.InstantiateAsync\<T>(T, int, Vector3, Quaternion)](/engine/7000.0/script-reference/unityengine/object/instantiateasync.md)
* [Object.InstantiateAsync\<T>(T, int, ReadOnlySpan\<Vector3>, ReadOnlySpan\<Quaternion>)](/engine/7000.0/script-reference/unityengine/object/instantiateasync.md)
* [Object.InstantiateAsync\<T>(T, int, Transform, Vector3, Quaternion)](/engine/7000.0/script-reference/unityengine/object/instantiateasync.md)
* [Object.InstantiateAsync\<T>(T, int, Transform, Vector3, Quaternion, CancellationToken)](/engine/7000.0/script-reference/unityengine/object/instantiateasync.md)
* [Object.InstantiateAsync\<T>(T, int, Transform, ReadOnlySpan\<Vector3>, ReadOnlySpan\<Quaternion>)](/engine/7000.0/script-reference/unityengine/object/instantiateasync.md)
* [Object.InstantiateAsync\<T>(T, int, Transform, ReadOnlySpan\<Vector3>, ReadOnlySpan\<Quaternion>, CancellationToken)](/engine/7000.0/script-reference/unityengine/object/instantiateasync.md)
* [Object.InstantiateAsync\<T>(T, InstantiateParameters, CancellationToken)](/engine/7000.0/script-reference/unityengine/object/instantiateasync.md)
* [Object.InstantiateAsync\<T>(T, int, InstantiateParameters, CancellationToken)](/engine/7000.0/script-reference/unityengine/object/instantiateasync.md)
* [Object.InstantiateAsync\<T>(T, Vector3, Quaternion, InstantiateParameters, CancellationToken)](/engine/7000.0/script-reference/unityengine/object/instantiateasync.md)
* [Object.InstantiateAsync\<T>(T, int, Vector3, Quaternion, InstantiateParameters, CancellationToken)](/engine/7000.0/script-reference/unityengine/object/instantiateasync.md)
* [Object.InstantiateAsync\<T>(T, int, ReadOnlySpan\<Vector3>, ReadOnlySpan\<Quaternion>, InstantiateParameters, CancellationToken)](/engine/7000.0/script-reference/unityengine/object/instantiateasync.md)
* [Object.Instantiate(Object, Vector3, Quaternion)](/engine/7000.0/script-reference/unityengine/object/instantiate.md#instantiate\(object-vector3-quaternion\))
* [Object.Instantiate(Object, Vector3, Quaternion, Transform)](/engine/7000.0/script-reference/unityengine/object/instantiate.md#instantiate\(object-vector3-quaternion-transform\))
* [Object.Instantiate(Object)](/engine/7000.0/script-reference/unityengine/object/instantiate.md#instantiate\(object\))
* [Object.Instantiate(Object, Scene)](/engine/7000.0/script-reference/unityengine/object/instantiate.md#instantiate\(object-scene\))
* [Object.Instantiate\<T>(T, InstantiateParameters)](/engine/7000.0/script-reference/unityengine/object/instantiate.md)
* [Object.Instantiate\<T>(T, Vector3, Quaternion, InstantiateParameters)](/engine/7000.0/script-reference/unityengine/object/instantiate.md)
* [Object.Instantiate(Object, Transform)](/engine/7000.0/script-reference/unityengine/object/instantiate.md#instantiate\(object-transform\))
* [Object.Instantiate(Object, Transform, bool)](/engine/7000.0/script-reference/unityengine/object/instantiate.md#instantiate\(object-transform-bool\))
* [Object.Instantiate\<T>(T)](/engine/7000.0/script-reference/unityengine/object/instantiate.md)
* [Object.Instantiate\<T>(T, Vector3, Quaternion)](/engine/7000.0/script-reference/unityengine/object/instantiate.md)
* [Object.Instantiate\<T>(T, Vector3, Quaternion, Transform)](/engine/7000.0/script-reference/unityengine/object/instantiate.md)
* [Object.Instantiate\<T>(T, Transform)](/engine/7000.0/script-reference/unityengine/object/instantiate.md)
* [Object.Instantiate\<T>(T, Transform, bool)](/engine/7000.0/script-reference/unityengine/object/instantiate.md)
* [Object.Destroy(Object, float)](/engine/7000.0/script-reference/unityengine/object/destroy.md)
* [Object.DestroyImmediate(Object, bool)](/engine/7000.0/script-reference/unityengine/object/destroyimmediate.md)
* [Object.FindObjectsByType(Type)](/engine/7000.0/script-reference/unityengine/object/findobjectsbytype.md#findobjectsbytype\(type\))
* [Object.FindObjectsByType(Type, FindObjectsInactive)](/engine/7000.0/script-reference/unityengine/object/findobjectsbytype.md#findobjectsbytype\(type-findobjectsinactive\))
* [Object.DontDestroyOnLoad(Object)](/engine/7000.0/script-reference/unityengine/object/dontdestroyonload.md)
* [Object.FindAnyObjectByType\<T>()](/engine/7000.0/script-reference/unityengine/object/findanyobjectbytype.md#findanyobjectbytypet\(\))
* [Object.FindAnyObjectByType\<T>(FindObjectsInactive)](/engine/7000.0/script-reference/unityengine/object/findanyobjectbytype.md#findanyobjectbytypet\(findobjectsinactive\))
* [Object.FindObjectsByType\<T>()](/engine/7000.0/script-reference/unityengine/object/findobjectsbytype.md#findobjectsbytypet\(\))
* [Object.FindObjectsByType\<T>(FindObjectsInactive)](/engine/7000.0/script-reference/unityengine/object/findobjectsbytype.md#findobjectsbytypet\(findobjectsinactive\))
* [Object.FindAnyObjectByType(Type)](/engine/7000.0/script-reference/unityengine/object/findanyobjectbytype.md#findanyobjectbytype\(type\))
* [Object.FindAnyObjectByType(Type, FindObjectsInactive)](/engine/7000.0/script-reference/unityengine/object/findanyobjectbytype.md#findanyobjectbytype\(type-findobjectsinactive\))
* [Object.ToString()](/engine/7000.0/script-reference/unityengine/object/tostring.md)
* [Object.name](/engine/7000.0/script-reference/unityengine/object/name.md)
* [Object.hideFlags](/engine/7000.0/script-reference/unityengine/object/hideflags.md)

### Operators

| Operator                                                                           | Description                                                             |
| ---------------------------------------------------------------------------------- | ----------------------------------------------------------------------- |
| [operator ==](/engine/7000.0/script-reference/unityengine/object/op-equality.md)   | Compares two object references to see if they refer to the same object. |
| [bool](/engine/7000.0/script-reference/unityengine/object/op-implicit.md)          | Determines whether the object exists.                                   |
| [operator !=](/engine/7000.0/script-reference/unityengine/object/op-inequality.md) | Compares if two objects refer to a different object.                    |
