Not switching textures at runtime

I have read tutorial but failed to understand about switching textures. I had created some buttons with different textures and their is a big box. when i click the particular button. it is switching the texture but its display all meshintances texture in that big box.

help me some logic that, It will only change one perticular button texture. here is my editor file
thanks
https://playcanvas.com/editor/scene/1790115

Hi @rehman97,

I’m not sure how are you going to change textures, your buttons have a color attached, not a texture.

So I’ve fixed your code to connect your buttons to your main switching script, and now the color of the cube is updated on click:

https://playcanvas.com/editor/scene/1790233

thanks Leonidas, and what if I means any type of image sprite, click to change.