#Through Menu UI, I would like to catalog different materials that I can make an object in the scene

1 messages · Page 1 of 1 (latest)

bleak plaza
#

Good evening, everyone. I would like to create a Menu UI, which I call up via the "Menu" button on my Quest 2. From it I would like to catalog different materials (which I already have in the Asset downloaded) and be able to change the material present in an object in the scene (perhaps selecting it from XR Controller) with one from the previous catalog. Any thoughts on this? Where to start?

bleak plaza
#

this is a test scene. in it i created a "Change Material" menu. Each button will correspond to a material linked to the "MaterialSelect" script attached to the red cube you see. In addition there is a Reset button that resets the color of the cube for me.

#

this is my "MaterialSelect" script. This is called in OnClick() by the different Buttons.

#

Now based on this, I would like to change it like this: I have the different materials (in my example case 5). From the menu choose the material and then apply it to the cube via raycast interaction. How can I implement this? So the keep the material selected and then apply it to the object?

cold flame
bleak plaza
#

that in my case I will translate it through Dropdown and in each entry of it is the array material.

cold flame
#

Just have a field that is assigned the material on button press, and then that assigned material is used by the raycast