---
title: GetComponentDataRW<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/component/getcomponentdatarw
latest_url: https://docs.unity.com/en-us/engine/7000.0/script-reference/unityengine/component/getcomponentdatarw.md
last_updated: 2026-12-01
generated_at: 2026-12-01T07:03:20.479Z
locale: en-us
---

# GetComponentDataRW<T>()

> Gets a read/write reference to the ComponentData T, an IComponentData, on the GameObject this Component is attached to.

## 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 RefRW<T> GetComponentDataRW<T>() where T : unmanaged, IComponentData
```

### Returns

| Type                                                                  | Description                                                                         |
| --------------------------------------------------------------------- | ----------------------------------------------------------------------------------- |
| [RefRW\<T>](/engine/7000.0/script-reference/unity/entities/refrw1.md) | A reference to the value. Getting it bumps the change version of the ComponentData. |

### Remarks

Same as [GameObject.GetComponentDataRW](/engine/7000.0/script-reference/unityengine/gameobject/getcomponentdatarw.md) on [Component.gameObject](/engine/7000.0/script-reference/unityengine/component/gameobject.md).

Throws an `ArgumentException` if the GameObject has been destroyed or doesn't have the ComponentData.

Waits for the jobs that read or write `T` to complete. To avoid the wait, access `T` in a job through a `Unity.Entities.ComponentLookup`. The job then runs after the jobs that read or write `T`, instead of the main thread waiting for them.
