Change Target object Material



I have a Target object in my project and as a child of that Target I have a plane called ChartImage. What i want to do is hit a button, and change ChartImage’s material. I have already added two materials to ChartImage and I know the button is working because it changes color I press and release it. If anyone has any advice, I would greatly appreciate it.


I found just using states to change it work easier for me. No coding just call the state you want it to be.



Thanks, that worked perfectly!

out of curiosity, do you know why my code didn’t work?



First, from a coding point of view, I’m also a bit confused, about what you should/could do with the materials properties… :grin:

But, one way to do it, is by using the skin() function and setting dynamically the material.


const materialDown = symbol.mediaFiles.your_image_file_down;
const materialUp = symbol.mediaFiles.your_image_file_up;

symbol.nodes.your_button.on("pointerdown", (e) => {;

symbol.nodes.your_button.on("pointerup", (e) => {;



I was going to say the something. I thought you needed to use (skin) to change it.

But to just to change it faster to what I want I’ll use the states.