0 votes
by (8.2k points)

In week 2 changing the floor texture, when I chose a component that has only 1 element in materials and applied that mesh to the button's on-click function, it's working

But when I choose a floor mesh that has 4 elements in the materials, the texture isn't changing Why so?

by (8.2k points)

If I directly try replacing the element, I can see that the material has changed But when I'm using buttons, there is no change.

1 Answer

0 votes
by (8.2k points)
edited by
  • You cannot change the desired materials from the list in a single mesh if you are creating this experience without coding make sure you use mesh with 1 material per mesh.
  • Make sure there is only one material.
  • You need to add all of them to a single button's on-click function.
  • To accomplish this you're going to have to do something called UV mapping.
  • Either you know how to manipulate atlas texture or the simple call is to

    • Place a quad on top of that face of the cube (you could actually make a new cube of 5 quads or less)
    • Cut the part of the atlas map
    • Create a new texture and assign it to a material
    • Apply that material to the quad.

    Then you can swap the texture of that material without affecting other faces.

TechXR runs courses in AR / VR / Metaverse / Game Development. Some of the popular Q&A in our courses are available here for easy discovery.

113 questions

117 answers

8 comments

99.7k users

...