---
title: AddBuffer<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/gameobject/addbuffer
latest_url: https://docs.unity.com/en-us/engine/7000.0/script-reference/unityengine/gameobject/addbuffer.md
last_updated: 2026-12-01
generated_at: 2026-12-01T07:10:31.862Z
locale: en-us
---

# AddBuffer<T>()

> Adds a Buffer of T elements, an IBufferElementData, to this GameObject.

## Definition

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

```csharp
public DynamicBuffer<T> AddBuffer<T>() where T : unmanaged, IBufferElementData
```

### Returns

| Type                                                                                  | Description                                                                |
| ------------------------------------------------------------------------------------- | -------------------------------------------------------------------------- |
| [DynamicBuffer\<T>](/engine/7000.0/script-reference/unity/entities/dynamicbuffer1.md) | The Buffer. If the GameObject already had the Buffer, the existing Buffer. |

### Remarks

Throws an `ArgumentException` if the GameObject has been destroyed.

This is a structural change: it waits for all jobs in the World to complete. To make it from a job or a system without waiting, record it in a `Unity.Entities.EntityCommandBuffer` instead.
