How to change texture on button click?

Hello guys,

I’m still a newbie to Babylon and I’m trying to change the material of an imported 3D scan by a button click created with Babylon GUI, but it only changes the color of the scan to white. I tried to export it with two materials, so I can use getMaterialByName and change on click, but when I open it with Sandbox, it has only one material. Also, I tried creating new material with new textures, but the scan changes the color to white again.

Do you have any advice?

Hi, and welcome!

Yes, of course, we will be happy to help. Want to share what you’ve got till now? Maybe a working playground, so we will know what needs to be fixed?

The problem doesn’t seem to be difficult, but playground example would be definitely helpful.
Here is the information how to use your models in Playground - Using External Assets In the Playground | Babylon.js Documentation

1 Like

Thank you so much, I already fixed my problem :))

1 Like