Direction of textures on cube

I have a cube which is basically 6 planes grouped together so that I could dynamically apply different textures to each face. The problem is that unlike a die, the textures on the faces are not symmetrical. So, when the face at the front goes to the back it is facing downwards. Now if you rotate the cube sideways, it comes to the front as facing downwards. Couple of questions:

1.) How should I code such that once the faces comes to the front, they are facing upwards?

2.) Where should I code this? In the Update function? Is there a event I could call just on the cube rotation?

Thanks
Syed

Is there a specific reason you are using 6 planes? I know that with Sprites you can multiply the scale by -1 to swap a texture, but not sure how that works with planes.

Do you have a code snippet to show how it is done with Sprites? The sprites are 2D whereas the cube is 3d so I don’t know how I could arrange the sprites along the z-axis when forming the cube.

Thanks,
Syed

function Reverse()
{
     shield_armor_bars.transform.localScale.x = shield_armor_bars.transform.localScale.x * -1.0f;
}

This piece of code I used to mirror a sprite.

1 Like

Thanks! I used sprites insteads of quads and applied them dynamically to the SpriteRenderer of gameobjects. I can position the gameobjects in 3d coords. Whenever a sprite is forward facing, I rotate it in the upward direction if it isn’t already.