I am working on a project related to making a voxel world. Currently, I am working on improving the game performance, which isn’t going great. I have seen a method which basically hides the faces that can’t be seen. A problem I face is that when I hide a face of one mesh, it hides that specific face of al the other meshes. This makes no sense to me as to why this is happening.
This is the world…
Each block in the world is in a 2d array called “chunks”. In the screenshot above, all I do is make the first block’s material’s face null, (index 0 means the right sided face), making the face transparent. I did this only for the first block of the world (chunks), but this made all the blocks’s right face transparent for some reason. I made each block an object with a mesh and other properties. The code of my project is below:
Link to my project
Any help would be very nice! Thanks!