# Example of changing per-instance data at runtime in the Built-In Render Pipeline

> An example of using MaterialPropertyBlock objects to set the color property of an instanced shader.

> **Important:**
>
> The Built-In Render Pipeline is deprecated and will be made obsolete in a future release.
>
> It remains supported, including bug fixes and maintenance, through the full Unity 6.7 LTS lifecycle.
>
> For more information on migration, refer to [Migrating from the Built-In Render Pipeline to the Universal Render Pipeline](/engine/6000.7/manual/render-pipelines/universal-render-pipeline/introduction/installing-and-configuring-urp/upgrading-from-birp.md.md) and [Render pipeline feature comparison](/engine/6000.7/manual/render-pipelines/choose-a-render-pipeline/feature-comparison.md.md).

The following example demonstrates how to use MaterialPropertyBlock objects to set per-instance data for a group of GameObjects at runtime. It sets the `_Color` property from the above shader examples to a random color.

> **Important:**
>
> MaterialPropertyBlocks break SRP Batcher compatibility. For more information, see [GPU instancing: Requirements and Compatibility](/engine/6000.7/manual/analysis/graphics-performance-profiling/reduce-draw-calls/gpuinstancing/gpuinstancing.md#requirements-and-compatibility).

```lang-cs
using UnityEngine;

public class MaterialPropertyBlockExample : MonoBehaviour
{
    public GameObject[] objects;

    void Start()
    {
        MaterialPropertyBlock props = new MaterialPropertyBlock();
        MeshRenderer renderer;

        foreach (GameObject obj in objects)
        {
            float r = Random.Range(0.0f, 1.0f);
            float g = Random.Range(0.0f, 1.0f);
            float b = Random.Range(0.0f, 1.0f);
            props.SetColor("_Color", new Color(r, g, b));

            renderer = obj.GetComponent<MeshRenderer>();
            renderer.SetPropertyBlock(props);
        }
    }
}
```
