# \[Studio\] ecs.GltfModel Update Material

**URL:** <https://forum.8thwall.com/t/studio-ecs-gltfmodel-update-material/3678>\
**Category:** Technical Support\
**Tags:** general\
**Created:** [November 21, 2024, 7:11pm UTC](https://forum.8thwall.com/t/studio-ecs-gltfmodel-update-material/3678 "2024-11-21T19:11:13Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Emilio\_Martinez](https://avatars.discourse-cdn.com/v4/letter/e/ccd318/32.png) [@Emilio\_Martinez](https://forum.8thwall.com/u/Emilio_Martinez)\
**Post date:** [November 21, 2024, 7:11pm UTC](https://forum.8thwall.com/t/studio-ecs-gltfmodel-update-material/3678/1 "2024-11-21T19:11:14Z")

</div>

I instantiate a model with this code  
ecs.Gltf Model.set(world, eid, {url: prefab}),  
how can I change or update the material?

---

<div class="post-metadata">

**Author:** ![GeorgeButler](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.8thwall.com/georgebutler/32/1903_2.png) [@GeorgeButler](https://forum.8thwall.com/u/GeorgeButler)\
**Post date:** [November 21, 2024, 9:34pm UTC](https://forum.8thwall.com/t/studio-ecs-gltfmodel-update-material/3678/2 "2024-11-21T21:34:23Z")

</div>

Hey! Welcome to the forums.

You want to set the Material component on the entity. You can view the properties here:

> **[Material | 8th Wall](https://www.8thwall.com/docs/studio/api/ecs/Material/)**
>
> ecs.Material

```ts
ecs.Material.set(world, eid, { r: 255, g: 0, b: 0, textureSrc: "assets/texture.png" })

```

---

<div class="post-metadata">

**Author:** ![Emilio\_Martinez](https://avatars.discourse-cdn.com/v4/letter/e/ccd318/32.png) [@Emilio\_Martinez](https://forum.8thwall.com/u/Emilio_Martinez)\
**Post date:** [November 22, 2024, 1:55pm UTC](https://forum.8thwall.com/t/studio-ecs-gltfmodel-update-material/3678/3 "2024-11-22T13:55:09Z")

</div>

Not working with Gltf Model, If I instantiate the built-in primitive as: ecs.BoxGeometry.set(world, eid, {width: 2.8, height: 0.8, depth: 1.9}) and set the Material it works fine but it doesn’t work with the Gltf Model
