Applying 6 different textures to a cube at runtime (SOLVED)

I can do the UV map and apply it to a cube. And I can apply a different texture that replaces the entire texture, but what I don’t understand is how to make it easy to change one side of the cube to a new texture? I’m guessing I need to use shaders but I don’t understand how to just impact one side of the cube without replacing the entire texture.

What is the best way to do this?

Edit: Looking at using a mesh instead of a model. Does this make sense? Should I go this route?

I might be making progress. If I update my material. to have 6 samplers it allows me to select 6 different images to apply. Now I just need to workout how they lay on the object properly.

1 Like

ok, i fixed it but I think there is a graphical bug in the UI so it took me a bit longer to fix than it should.

First thing you need to know to get this to work is you need to apply a different material to each face of the dice.
You need to UV Unwrap each face individually. Then apply the material to each face.

Finally you have to export to glb as dae doesn’t work correctly (at least not when I tried).

Then apply a material to each face of the dice (I named the sides face1, face2, face3, etc… in blender)

Then just apply the texture you want for each face.

So what was is the defold graphical bug? It will only show one texture in the dev UI preview. But at run time it gives you all the faces.

See this really isn’t a 1 pip on each face, but graphically it just shows up this way (so naturally I thought it wasn’t working).

1 Like