Different material on each face of a cube from scripting

Hi,

This is most certainly a newbie question, but does someone has some sample code for rendering a Different material on each face of a cube from scripting?

I created a primitive cube to start.

Thanks in advance

Don’t have any sample code for you but here is an idea.

If you create 6 planes and arrange them on the faces of the cube, then it is reasonably simple in code to change the textures of the materials you put on the planes. If they are named ‘plane1’ etc and parented to the cube then the cube’s code can easily access them.

I found some sample code here a while ago to dynamically change textures in scripts. I’ll maybe have a look for it again.

But you said ‘change material’ not texture. I assume you can do that too but do you just mean change textures, ie the pictures on the cube?

Yes that is what I meant. Ok thanks I will try this.