Search Unity

How to map texture to cubes

Discussion in 'Scripting' started by Eiseno, Aug 28, 2019.

  1. Eiseno

    Eiseno

    Joined:
    Nov 1, 2015
    Posts:
    81
    Hello i have 25x25 cubes at scene and i have 1000x1000 texture. I want to map this texture to that cubes. How can i make that ?

    I add an example picture.
     

    Attached Files:

  2. Baste

    Baste

    Joined:
    Jan 24, 2013
    Posts:
    4,392
    By setting the tiling and offset values on the cube's material.

    Each cube should have tiling of 1/25, and an offset of 1/25 * index (ie. the cube that's the third from the left and the fourth from the bottom should have offset of x = 3/25 and y = 4/25).

    The size of the texture won't matter.
     
    Eiseno likes this.
  3. Eiseno

    Eiseno

    Joined:
    Nov 1, 2015
    Posts:
    81
    Thank you it worked perfectly :)