---
title: SetComponentData<T>(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/setcomponentdata
latest_url: https://docs.unity.com/en-us/engine/7000.0/script-reference/unityengine/gameobject/setcomponentdata.md
last_updated: 2026-12-01
generated_at: 2026-12-01T07:18:31.503Z
locale: en-us
---

# SetComponentData<T>(T)

> Sets the value of the ComponentData T, an IComponentData, on 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 void SetComponentData<T>(T componentData) where T : unmanaged, IComponentData
```

### Parameters

**** (T): The new value.

### Remarks

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.
