# ObjectTransform

<Badge tone="type">class · immutable data</Badge>

```csharp
public class ObjectTransform
```

**Namespace:** `AR51.Unity.SDK`

A plain, immutable data class describing a single object's pose. Construct one and hand it to [`ObjectTransformConsumer.OnObject`](/docs/sdk-api/unity-api/classes/objecttransformconsumer); the consumer creates (if new) or updates a prefab GameObject keyed by `Id`, selecting the prefab by `Type`. All properties are get-only — there is no way to mutate a pose after construction.

:::caution[Units]
`Position` is in **Unity world-space meters**. `Scale` is a local scale (unitless multiplier). Use a [`Quaternion`](https://docs.unity3d.com/ScriptReference/Quaternion.html) for `Rotation`, not Euler degrees.
:::

## Properties

All get-only.

<div className="apiPropTable">

| Property | Type | Description |
|---|---|---|
| `Id` | `string` | object identifier — the key the consumer tracks GameObjects by |
| `Type` | `string` | object type — selects which prefab the consumer instantiates |
| `Position` | [`Vector3`](https://docs.unity3d.com/ScriptReference/Vector3.html) | world-space position, in **meters** |
| `Rotation` | [`Quaternion`](https://docs.unity3d.com/ScriptReference/Quaternion.html) | world-space rotation |
| `Scale` | [`Vector3`](https://docs.unity3d.com/ScriptReference/Vector3.html) | local scale |

</div>

## Constructors

```csharp
public ObjectTransform(string id, string type, Vector3 position);
public ObjectTransform(string id, string type, Vector3 position, Quaternion rotation);
public ObjectTransform(string id, string type, Vector3 position, Quaternion rotation, Vector3 scale);
```

Three overloads, from minimal to full pose. Omitted arguments take Unity defaults:

| Constructor | `Rotation` | `Scale` |
|---|---|---|
| `(id, type, position)` | `Quaternion.identity` | `Vector3.one` |
| `(id, type, position, rotation)` | supplied | `Vector3.one` |
| `(id, type, position, rotation, scale)` | supplied | supplied |

<Example inferred>

```csharp
// Place an object 2 m forward, 1 m up — meters, Unity world space.
var pose = new ObjectTransform(
    id: "crate-7",
    type: "crate",
    position: new Vector3(0f, 1f, 2f));

ObjectTransformConsumer.Instance.OnObject(pose);
```

</Example>

## See also

- [`ObjectTransformConsumer`](/docs/sdk-api/unity-api/classes/objecttransformconsumer) — receives these poses via `OnObject` and maintains the matching prefab GameObjects
- [`XRHeadsetTracker`](/docs/sdk-api/unity-api/classes/xrheadsettracker) — feeds per-device poses into the consumer as `ObjectTransform`s of type `"XR"`
- [Object detection](/docs/sdk-api/unity-api/object-detection) — area overview
- [Class index](/docs/sdk-api/unity-api/classes) — all Unity SDK types
