Apply texture to a bar (cube)


I’m feeling so stupid to ask this question but I didn’t find any help.

I try to apply a texture to this bar.
But it’s impossible to tile this texture a way that it looks nice on every face of the cube.
Is there a way to texture the cube’s faces individually?

What do I have to do so it looks like this (right side):

Sorry for my bad english.


Are you using a texture? You can use :

Set the tiling based on the scale of the object :

function Update () 
    var scaleX : float = transform.localScale.x;
    var scaleY : float = transform.localScale.y;
    renderer.material.mainTextureScale = Vector2( scaleX, scaleY );

You should either:

a) make the cube from 6 separate planes, texture each with a different material, all using the same texture, but tile as needed, group under an empty game object

b) use a modeler like Blender or Maya or Max and create a UV map for the single mesh cube you’re using. Adjust the UV map as needed, then you can use one material.