Help to create a 2D chessboard with one object (texture problem)
Hi! The chessboard is a very simplified example, but it will do now. So, how should I do the texture part of a 2D top-down chessboard with only one object?
Let me explain: I have a grid structure and I build up the quad meshes on it by a script. I have two materials (black and white square). I could load the different material in the script during the mesh generation. Theoretically it load the proper one, but when the last square rendered the whole chessboard change color equal to the last square, It overwrite or I don't know what happening. So, I saw a full white board instead of two colored one...
How can I do it properly? What is the solution if I need to use only one object and render two different material on it? Please help or give me some idea!
Answer by skaulakis · Feb 01, 2020 at 01:48 PM
Hi. It is hard to understand what you are asking.
Maybe you could add some photos and then I can answer.
Answer by Lazy_Sloth · Feb 01, 2020 at 03:41 PM
Ok, I show you two picture about my project. I tried to explain the important things there. As I mentioned before the chessboard thing was a simplified example.
I don't want to use different objects for all the different materials as it would cause a lot of unnecessary object later (I will add more and more tile types).
I prefer to use only a few object (as layers) and change the materials in it, which represent the different type of tile (as looks different). What you see on the pictures is my layer_0 the "terrain" layer. Ground + hills etc etc.. But everything looks the same color which means everything from the same tileset/material, but why?
As you see in the script, I loaded the proper material for each tile, which means they must look in different colors. I know difficult to understand :)
Your answer
![](https://koobas.hobune.stream/wayback/20220612222524im_/https://answers.unity.com/themes/thub/images/avi.jpg)