how do i wrap a texture around a cuboid so it repeats?

i made a texture for a cube in blender and added some code for it to wrap around it and it works fine, but is there any way for a texture to repeat on a single object and wrap around parts of that? ive made it just repeat but the when the texture wraps around it’s just 1 texture wrapping around the whole thing.

You just use the Tiling value of the material.

With Default Tiling
alt text

With Tiling set to 3x 3y
alt text

Also important to note that the texture needs to be set to Repeat Wrap mode:
alt text

If you want more control you’d probably want to learn about UV Unwrapping in 3D modelling software, but that’s all for just simply adding a texture.

i tried it but it doesn’t work. it’s probably because my texture is different on every side. here’s the code i used to wrap it:

public class cubewrap : MonoBehaviour
{

    MeshFilter cubemesh;
    Mesh mesh;
    // Start is called before the first frame update
    void Start()
    {
        cubemesh = GetComponent<MeshFilter>();
        mesh = cubemesh.mesh;
        Vector2[] uvMap = mesh.uv;

        uvMap[0] = new Vector2(0.375f, 1);
        uvMap[1] = new Vector2(0.375f, 0.75f);
        uvMap[2] = new Vector2(0.625f, 1);
        uvMap[3] = new Vector2(0.625f, 0.75f);

        uvMap[4] = new Vector2(0.625f, 0.75f);
        uvMap[5] = new Vector2(0.625f, 0.5f);
        uvMap[8] = new Vector2(0.875f, 0.75f);
        uvMap[9] = new Vector2(0.875f, 0.5f);

        uvMap[6] = new Vector2(0.375f, 0.5f);
        uvMap[7] = new Vector2(0.375f, 0.25f);
        uvMap[10] = new Vector2(0.625f, 0.5f);
        uvMap[11] = new Vector2(0.625f, 0.25f);

        uvMap[12] = new Vector2(0.125f, 0.5f);
        uvMap[13] = new Vector2(0.125f, 0.75f);
        uvMap[14] = new Vector2(0.375f, 0.75f);
        uvMap[15] = new Vector2(0.375f, 0.5f);

        uvMap[16] = new Vector2(0.375f, 0.25f);
        uvMap[17] = new Vector2(0.625f, 0.25f);
        uvMap[18] = new Vector2(0.625f, 0);
        uvMap[19] = new Vector2(0.375f, 0);

        uvMap[20] = new Vector2(0.375f, 0.75f);
        uvMap[21] = new Vector2(0.625f, 0.75f);
        uvMap[22] = new Vector2(0.625f, 0.5f);
        uvMap[23] = new Vector2(0.375f, 0.5f);

        mesh.uv = uvMap;
    }
}