<!--
{
  "availability" : [
    "iOS: 27.0.0 -",
    "iPadOS: 27.0.0 -",
    "macOS: 27.0.0 -",
    "tvOS: 27.0.0 -",
    "visionOS: 27.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "RealityKit",
  "identifier" : "/documentation/RealityKit/ComputeGraphSharedUniforms/setUniformTransform(_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "RealityKit",
      "ComputeGraph",
      "_RealityKit_ComputeGraph"
    ],
    "preciseIdentifier" : "s:24_RealityKit_ComputeGraph0cD14SharedUniformsC19setUniformTransformyyxx_0A10Foundation6EntityCtcs15BitwiseCopyableRzlF"
  },
  "title" : "setUniformTransform(_:)"
}
-->

# setUniformTransform(_:)

Registers a closure that transforms a uniform value of type `V` on a per-entity basis.

```
func setUniformTransform<V>(_ transform: @escaping (V, Entity) -> V) where V : BitwiseCopyable
```

## Parameters

`transform`

A closure `(V, Entity) -> V`.

## Discussion

The closure receives the current value and the entity being evaluated,
and returns the transformed value. This lets you derive per-entity
variants of a global uniform at simulation time, for example, converting
a position from the scene’s coordinate system to the system’s coordinate system.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)