# A custom component to attach to a button that will play an animation from a glb file

**URL:** https://forum.8thwall.com/t/a-custom-component-to-attach-to-a-button-that-will-play-an-animation-from-a-glb-file/7029
**Category:** Technical Support
**Tags:** glb, studio
**Created:** [June 14, 2025, 6:06pm UTC](https://forum.8thwall.com/t/a-custom-component-to-attach-to-a-button-that-will-play-an-animation-from-a-glb-file/7029 "2025-06-14T18:06:32Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![Matthew\_Knowles](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.8thwall.com/matthew_knowles/32/1985_2.png) [@Matthew\_Knowles](https://forum.8thwall.com/u/Matthew_Knowles)
#### Post date: [June 14, 2025, 6:06pm UTC](https://forum.8thwall.com/t/a-custom-component-to-attach-to-a-button-that-will-play-an-animation-from-a-glb-file/7029/1 "2025-06-14T18:06:32Z")

</div>

First of all, I am not a coder and trying to do everything in Studio. I have been able to copy and paste some custom components but I can’t find anything that does this. I have a glb and I want to have a button on screen that when clicked, plays a specific animation associated with the glb. Does anyone have a simple script for this? I have been trying to get ChatGPT to do it and it keeps hallucinating…thinking it knows 8th wall Studio but it doesn’t. Thanks!

---

<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: [June 16, 2025, 6:41pm UTC](https://forum.8thwall.com/t/a-custom-component-to-attach-to-a-button-that-will-play-an-animation-from-a-glb-file/7029/2 "2025-06-16T18:41:56Z")

</div>

Have you taken a look at the button sample project? It’s pretty similar, however instead of adding a ScaleAnimation you would mutate your GltfModel component to change the current animationClip.

> **[Studio: Button | 8th Wall | 8th Wall](https://www.8thwall.com/8thwall/studio-call-to-action)**
>
> This project demonstrates how to create a 3D label in your scene that redirects users to another website when clicked, using built-in UI elements.

> **[GltfModel | 8th Wall](https://www.8thwall.com/docs/api/studio/ecs/gltf-model/#mutate)**
>
> Description

---

<div class="post-metadata">

### Author: ![Matthew\_Knowles](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.8thwall.com/matthew_knowles/32/1985_2.png) [@Matthew\_Knowles](https://forum.8thwall.com/u/Matthew_Knowles)
#### Post date: [June 16, 2025, 10:47pm UTC](https://forum.8thwall.com/t/a-custom-component-to-attach-to-a-button-that-will-play-an-animation-from-a-glb-file/7029/3 "2025-06-16T22:47:11Z")

</div>

Yes, the button example works well. I did not know about the mutate thing.Thanks, I’ll see if I can make it work.

---

<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: [June 16, 2025, 10:59pm UTC](https://forum.8thwall.com/t/a-custom-component-to-attach-to-a-button-that-will-play-an-animation-from-a-glb-file/7029/4 "2025-06-16T22:59:53Z")

</div>

Sounds good! I’d also recommend joining our Discord: [8th Wall](https://discord.gg/pbseyKanUc)
